1 |
|
2 | import ImportedHashids from '../cjs'
|
3 |
|
4 | describe('requiring', () => {
|
5 | test('via node', () => {
|
6 |
|
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 | })
|