UNPKG

652 BPlain TextView Raw
1// @ts-ignore
2import ImportedHashids from '../cjs'
3
4describe('requiring', () => {
5 test('via node', () => {
6 // eslint-disable-next-line @typescript-eslint/no-var-requires
7 const Hashids = require('../cjs')
8 expect(typeof Hashids).toBe('function')
9 const instance = new Hashids('Not Real', 5, 'ABCDEFGHJKMNPQRTWXY234689')
10 expect(instance).toBeInstanceOf(Hashids)
11 })
12
13 test('via babel default import', () => {
14 expect(typeof ImportedHashids).toBe('function')
15 const instance = new ImportedHashids(
16 'Not Real',
17 5,
18 'ABCDEFGHJKMNPQRTWXY234689',
19 )
20 expect(instance).toBeInstanceOf(ImportedHashids)
21 })
22})