-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
26 lines (18 loc) · 766 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// not much to do here until we have headless browser
// testing set up, but let's at least confirm the CommonJS
// exports work and match the ESM exports
const assert = require('assert')
const Scoper = require('./dist/index.js')
const { scopeIds, scopeOwnIds } = require('./dist/index.js')
assert(typeof Scoper === 'function')
assert(Scoper.name === 'Scoper')
const scoper = new Scoper()
assert(scoper instanceof Scoper)
assert(typeof scopeIds === 'function')
assert(scopeIds.name === 'scopeIds')
assert(typeof scopeOwnIds === 'function')
assert(scopeOwnIds.name === 'scopeOwnIds')
assert(typeof Scoper.scopeIds === 'function')
assert(Scoper.scopeIds === scopeIds)
assert(typeof Scoper.scopeOwnIds === 'function')
assert(Scoper.scopeOwnIds === scopeOwnIds)