polendina
Version:
Non-UI browser testing for JavaScript libraries from the command-line
20 lines (17 loc) • 687 B
JavaScript
/* globals describe it WorkerGlobalScope ServiceWorkerGlobalScope */
const { assert } = require('chai')
describe('test suite 2 - worker', () => {
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
it('is in serviceworker', () => {
assert.strictEqual(typeof ServiceWorkerGlobalScope, 'function')
})
} else if (typeof WorkerGlobalScope !== 'undefined' && global instanceof WorkerGlobalScope) {
it('is in worker', () => {
assert.strictEqual(typeof WorkerGlobalScope, 'function')
})
} else {
it('is not in worker', () => {
assert.strictEqual(typeof WorkerGlobalScope, 'undefined')
})
}
})