polendina 1.1.1 → 2.0.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +154 -0
- package/.github/workflows/test-and-release.yml +3 -0
- package/lib/log.js +8 -8
- package/lib/puppeteer.js +3 -5
- package/lib/webpack.config.js +8 -12
- package/lib/{wrap-loader.js → wrap-loader.cjs} +8 -5
- package/package.json +17 -13
- package/polendina-cli.js +7 -6
- package/polendina-node-cli.js +10 -6
- package/polendina.js +39 -18
- package/resources/bare-run.js +3 -3
- package/resources/bare.js +7 -5
- package/resources/common-run.js +23 -26
- package/resources/mocha-run.js +4 -5
- package/resources/tape-run.js +5 -5
- package/resources/test-registry.js +4 -1
- package/test/common.js +8 -8
- package/test/fixtures/bare-async/package.json +4 -1
- package/test/fixtures/bare-async/test-1.js +1 -1
- package/test/fixtures/bare-async/test-2.js +1 -1
- package/test/fixtures/bare-async-esm/index.js +3 -0
- package/test/fixtures/bare-async-esm/package.json +19 -0
- package/test/fixtures/bare-async-esm/test-1.js +16 -0
- package/test/fixtures/bare-async-esm/test-2.js +11 -0
- package/test/fixtures/bare-async-failure/package.json +4 -1
- package/test/fixtures/bare-async-failure/test-1.js +1 -1
- package/test/fixtures/bare-async-failure/test-2.js +2 -2
- package/test/fixtures/bare-async-failure-esm/index.js +3 -0
- package/test/fixtures/bare-async-failure-esm/package.json +19 -0
- package/test/fixtures/bare-async-failure-esm/test-1.js +16 -0
- package/test/fixtures/bare-async-failure-esm/test-2.js +11 -0
- package/test/fixtures/bare-sync/package.json +4 -1
- package/test/fixtures/bare-sync/test-1.js +1 -1
- package/test/fixtures/bare-sync/test-2.js +2 -1
- package/test/fixtures/bare-sync-esm/index.js +1 -0
- package/test/fixtures/bare-sync-esm/package.json +19 -0
- package/test/fixtures/bare-sync-esm/test-1.js +14 -0
- package/test/fixtures/bare-sync-esm/test-2.js +7 -0
- package/test/fixtures/bare-sync-failure/package.json +4 -1
- package/test/fixtures/bare-sync-failure/test-1.js +1 -1
- package/test/fixtures/bare-sync-failure/test-2.js +2 -2
- package/test/fixtures/bare-sync-failure-esm/index.js +1 -0
- package/test/fixtures/bare-sync-failure-esm/package.json +19 -0
- package/test/fixtures/bare-sync-failure-esm/test-1.js +14 -0
- package/test/fixtures/bare-sync-failure-esm/test-2.js +6 -0
- package/test/fixtures/mocha/package.json +2 -1
- package/test/fixtures/mocha/test-1.js +1 -1
- package/test/fixtures/mocha/test-2.js +1 -1
- package/test/fixtures/mocha/test-3.js +1 -1
- package/test/fixtures/mocha-esm/index.js +1 -0
- package/test/fixtures/{mocha8 → mocha-esm}/package.json +4 -2
- package/test/fixtures/{mocha8 → mocha-esm}/test-1.js +2 -2
- package/test/fixtures/{mocha8 → mocha-esm}/test-2.js +1 -1
- package/test/fixtures/{mocha8 → mocha-esm}/test-3.js +2 -2
- package/test/fixtures/mocha-failure/package.json +2 -1
- package/test/fixtures/mocha-failure/test.js +1 -1
- package/test/fixtures/mocha-failure-esm/package.json +20 -0
- package/test/fixtures/mocha-failure-esm/test.js +24 -0
- package/test/fixtures/tape/package.json +1 -1
- package/test/fixtures/tape-esm/index.js +1 -0
- package/test/fixtures/tape-esm/package.json +19 -0
- package/test/fixtures/tape-esm/test.js +47 -0
- package/test/fixtures/tape-failure/package.json +1 -1
- package/test/fixtures/tape-failure-esm/package.json +19 -0
- package/test/fixtures/tape-failure-esm/test.js +29 -0
- package/test/fixtures/webpack-merge/package.json +4 -1
- package/test/fixtures/webpack-merge/test.js +3 -4
- package/test/fixtures/webpack-merge/webpack.config.js +3 -3
- package/test/test-bare-async.js +92 -87
- package/test/test-bare-sync.js +92 -87
- package/test/test-mocha.js +101 -96
- package/test/test-polendina-node.js +44 -38
- package/test/test-tape.js +95 -90
- package/test/test-webpack-merge.js +11 -9
- package/CHANGELOG.md +0 -11
- package/test/fixtures/mocha8/index.js +0 -1
package/resources/mocha-run.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// in-browser setup and runner for Mocha, at end of bundle
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import mochaExport from 'mocha/mocha-es2018.js'
|
|
4
|
+
import { registry, executionQueue, log, setup } from './common-run.js'
|
|
5
5
|
|
|
6
6
|
function runMocha () {
|
|
7
7
|
// mocha@8 exports what we want, mocha@7 sets a global
|
|
8
|
-
const mochaLocal =
|
|
9
|
-
global._mocha = mochaLocal
|
|
8
|
+
const mochaLocal = mochaExport
|
|
10
9
|
mochaLocal.setup({ reporter: registry.argv.mochaReporter, ui: 'bdd' })
|
|
11
10
|
// mocha@7 deprecated useColors()
|
|
12
11
|
if (typeof mochaLocal.color === 'function') {
|
|
@@ -26,7 +25,7 @@ function runMocha () {
|
|
|
26
25
|
mochaLocal
|
|
27
26
|
.run((_errors) => { errors = _errors })
|
|
28
27
|
.on('end', (...args) => {
|
|
29
|
-
executionQueue(() =>
|
|
28
|
+
executionQueue(() => globalThis.polendinaEnd(errors))
|
|
30
29
|
})
|
|
31
30
|
}
|
|
32
31
|
|
package/resources/tape-run.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// in-browser setup and runner for Tape, at end of bundle
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import tape from 'tape'
|
|
4
|
+
import { registry, setup, executionQueue } from './common-run.js'
|
|
5
|
+
import { Transform } from 'stream'
|
|
5
6
|
|
|
6
7
|
function runTape () {
|
|
7
|
-
const { Transform } = require('stream')
|
|
8
8
|
let failures = 0
|
|
9
9
|
|
|
10
10
|
const stream = new Transform({
|
|
11
11
|
transform (chunk, encoding, callback) {
|
|
12
12
|
executionQueue(() => {
|
|
13
|
-
|
|
13
|
+
globalThis.polendinaWrite(chunk.toString())
|
|
14
14
|
.catch(callback)
|
|
15
15
|
.then(callback)
|
|
16
16
|
})
|
|
@@ -18,7 +18,7 @@ function runTape () {
|
|
|
18
18
|
|
|
19
19
|
flush (callback) {
|
|
20
20
|
executionQueue(() => {
|
|
21
|
-
|
|
21
|
+
globalThis.polendinaEnd(failures)
|
|
22
22
|
.catch(callback)
|
|
23
23
|
.then(callback)
|
|
24
24
|
})
|
package/test/common.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import path from 'path'
|
|
2
|
+
import assert from 'assert'
|
|
3
|
+
import { execFile } from 'child_process'
|
|
4
|
+
import { fileURLToPath } from 'url'
|
|
5
|
+
|
|
6
|
+
const __dirname = fileURLToPath(path.dirname(import.meta.url))
|
|
4
7
|
const cli = path.join(__dirname, '../polendina-cli.js')
|
|
5
8
|
|
|
6
|
-
async function runCli (cwd, args) {
|
|
9
|
+
export async function runCli (cwd, args) {
|
|
7
10
|
return runCommand(`${cli} test*.js --cleanup ${args || ''}`, cwd)
|
|
8
11
|
}
|
|
9
12
|
|
|
10
|
-
async function runCommand (command, cwd) {
|
|
13
|
+
export async function runCommand (command, cwd) {
|
|
11
14
|
return new Promise((resolve, reject) => {
|
|
12
15
|
const args = command.split(' ').filter(Boolean)
|
|
13
16
|
execFile(process.execPath, args, { cwd }, (err, stdout, stderr) => {
|
|
@@ -23,6 +26,3 @@ async function runCommand (command, cwd) {
|
|
|
23
26
|
})
|
|
24
27
|
})
|
|
25
28
|
}
|
|
26
|
-
|
|
27
|
-
module.exports.runCli = runCli
|
|
28
|
-
module.exports.runCommand = runCommand
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* globals WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
2
|
|
|
3
|
-
const assert = require('
|
|
3
|
+
const { assert } = require('chai')
|
|
4
4
|
|
|
5
5
|
module.exports = async function () {
|
|
6
6
|
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fixture-bare-async",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "test fixture",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "node test-1.js && node test-2.js"
|
|
9
|
+
},
|
|
10
|
+
"author": "Rod <rod@vagg.org> (http://r.va.gg/)",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/rvagg/polendina.git"
|
|
14
|
+
},
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"chai": "^4.3.4"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* globals WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
|
+
|
|
3
|
+
import { assert } from 'chai'
|
|
4
|
+
|
|
5
|
+
export default async function () {
|
|
6
|
+
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
7
|
+
console.log('testing is in serviceworker')
|
|
8
|
+
assert.strictEqual(typeof ServiceWorkerGlobalScope, 'function')
|
|
9
|
+
} else if (typeof WorkerGlobalScope !== 'undefined' && global instanceof WorkerGlobalScope) {
|
|
10
|
+
console.log('testing is in worker')
|
|
11
|
+
assert.strictEqual(typeof WorkerGlobalScope, 'function')
|
|
12
|
+
} else {
|
|
13
|
+
console.log('testing is not in worker')
|
|
14
|
+
assert.strictEqual(typeof WorkerGlobalScope, 'undefined')
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { assert } from 'chai'
|
|
2
|
+
import index from './index.js'
|
|
3
|
+
|
|
4
|
+
export async function test1 () {
|
|
5
|
+
console.log('testing bare fixture')
|
|
6
|
+
assert.strictEqual(await index(), 'bare test fixture')
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export async function test2 () {
|
|
10
|
+
assert.ok(true, 'yep')
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* globals WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
2
|
|
|
3
|
-
const assert = require('
|
|
3
|
+
const { assert } = require('chai')
|
|
4
4
|
|
|
5
5
|
module.exports = async function () {
|
|
6
6
|
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const assert = require('
|
|
1
|
+
const { assert } = require('chai')
|
|
2
2
|
const index = require('./')
|
|
3
3
|
|
|
4
4
|
module.exports.test1 = async function () {
|
|
@@ -7,5 +7,5 @@ module.exports.test1 = async function () {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
module.exports.test2 = async function () {
|
|
10
|
-
assert.fail('
|
|
10
|
+
assert.fail('faily mcfailface')
|
|
11
11
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fixture-bare-async-failure",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "test fixture",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "node test-1.js && node test-2.js"
|
|
9
|
+
},
|
|
10
|
+
"author": "Rod <rod@vagg.org> (http://r.va.gg/)",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/rvagg/polendina.git"
|
|
14
|
+
},
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"chai": "^4.3.4"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* globals WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
|
+
|
|
3
|
+
import { assert } from 'chai'
|
|
4
|
+
|
|
5
|
+
export default async function () {
|
|
6
|
+
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
7
|
+
console.log('testing is in serviceworker')
|
|
8
|
+
assert.strictEqual(typeof ServiceWorkerGlobalScope, 'function')
|
|
9
|
+
} else if (typeof WorkerGlobalScope !== 'undefined' && global instanceof WorkerGlobalScope) {
|
|
10
|
+
console.log('testing is in worker')
|
|
11
|
+
assert.strictEqual(typeof WorkerGlobalScope, 'function')
|
|
12
|
+
} else {
|
|
13
|
+
console.log('testing is not in worker')
|
|
14
|
+
assert.strictEqual(typeof WorkerGlobalScope, 'undefined')
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { assert } from 'chai'
|
|
2
|
+
import index from './index.js'
|
|
3
|
+
|
|
4
|
+
export async function test1 () {
|
|
5
|
+
console.log('testing bare fixture')
|
|
6
|
+
assert.strictEqual(await index(), 'bare test fixture')
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export async function test2 () {
|
|
10
|
+
assert.fail('faily mcfailface')
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* globals WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
2
|
|
|
3
|
-
const assert = require('
|
|
3
|
+
const { assert } = require('chai')
|
|
4
4
|
|
|
5
5
|
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
6
6
|
console.log('testing is in serviceworker')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default 'bare test fixture'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fixture-bare-sync",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "test fixture",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "node test-1.js && node test-2.js"
|
|
9
|
+
},
|
|
10
|
+
"author": "Rod <rod@vagg.org> (http://r.va.gg/)",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/rvagg/polendina.git"
|
|
14
|
+
},
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"chai": "^4.3.4"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* globals WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
|
+
|
|
3
|
+
import { assert } from 'chai'
|
|
4
|
+
|
|
5
|
+
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
6
|
+
console.log('testing is in serviceworker')
|
|
7
|
+
assert.strictEqual(typeof ServiceWorkerGlobalScope, 'function')
|
|
8
|
+
} else if (typeof WorkerGlobalScope !== 'undefined' && global instanceof WorkerGlobalScope) {
|
|
9
|
+
console.log('testing is in worker')
|
|
10
|
+
assert.strictEqual(typeof WorkerGlobalScope, 'function')
|
|
11
|
+
} else {
|
|
12
|
+
console.log('testing is not in worker')
|
|
13
|
+
assert.strictEqual(typeof WorkerGlobalScope, 'undefined')
|
|
14
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* globals WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
2
|
|
|
3
|
-
const assert = require('
|
|
3
|
+
const { assert } = require('chai')
|
|
4
4
|
|
|
5
5
|
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
6
6
|
console.log('testing is in serviceworker')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default 'bare test fixture'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fixture-bare-sync-failure",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "test fixture",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "node test-1.js && node test-2.js"
|
|
9
|
+
},
|
|
10
|
+
"author": "Rod <rod@vagg.org> (http://r.va.gg/)",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/rvagg/polendina.git"
|
|
14
|
+
},
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"chai": "^4.3.4"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* globals WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
|
+
|
|
3
|
+
import { assert } from 'chai'
|
|
4
|
+
|
|
5
|
+
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
6
|
+
console.log('testing is in serviceworker')
|
|
7
|
+
assert.strictEqual(typeof ServiceWorkerGlobalScope, 'function')
|
|
8
|
+
} else if (typeof WorkerGlobalScope !== 'undefined' && global instanceof WorkerGlobalScope) {
|
|
9
|
+
console.log('testing is in worker')
|
|
10
|
+
assert.strictEqual(typeof WorkerGlobalScope, 'function')
|
|
11
|
+
} else {
|
|
12
|
+
console.log('testing is not in worker')
|
|
13
|
+
assert.strictEqual(typeof WorkerGlobalScope, 'undefined')
|
|
14
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* globals describe it WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
2
|
|
|
3
|
-
const assert = require('
|
|
3
|
+
const { assert } = require('chai')
|
|
4
4
|
|
|
5
5
|
describe('test suite 2 - worker', () => {
|
|
6
6
|
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default 'polendina test'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "fixture-
|
|
2
|
+
"name": "fixture-mocha",
|
|
3
3
|
"version": "1.0.0",
|
|
4
4
|
"description": "test-fixture",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "mocha test-*.js"
|
|
8
9
|
},
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
"url": "https://github.com/rvagg/polendina.git"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
|
-
"
|
|
17
|
+
"chai": "^4.3.4",
|
|
18
|
+
"mocha": "~9.1.3"
|
|
17
19
|
}
|
|
18
20
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* globals describe it WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { assert } from 'chai'
|
|
4
4
|
|
|
5
5
|
describe('test suite 2 - worker', () => {
|
|
6
6
|
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* globals describe it WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
|
-
const assert = require('
|
|
2
|
+
const { assert } = require('chai')
|
|
3
3
|
|
|
4
4
|
describe('test suite 1 - worker', () => {
|
|
5
5
|
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fixture-mocha-failure",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "test fixture",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "mocha test-*.js"
|
|
9
|
+
},
|
|
10
|
+
"author": "Rod <rod@vagg.org> (http://r.va.gg/)",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/rvagg/polendina.git"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"chai": "^4.3.4",
|
|
18
|
+
"mocha": "~9.1.3"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* globals describe it WorkerGlobalScope ServiceWorkerGlobalScope */
|
|
2
|
+
import { assert } from 'chai'
|
|
3
|
+
|
|
4
|
+
describe('test suite 1 - worker', () => {
|
|
5
|
+
if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
|
|
6
|
+
it('is in serviceworker', () => {
|
|
7
|
+
assert.strictEqual(typeof ServiceWorkerGlobalScope, 'function')
|
|
8
|
+
})
|
|
9
|
+
} else if (typeof WorkerGlobalScope !== 'undefined' && global instanceof WorkerGlobalScope) {
|
|
10
|
+
it('is in worker', () => {
|
|
11
|
+
assert.strictEqual(typeof WorkerGlobalScope, 'function')
|
|
12
|
+
})
|
|
13
|
+
} else {
|
|
14
|
+
it('is not in worker', () => {
|
|
15
|
+
assert.strictEqual(typeof WorkerGlobalScope, 'undefined')
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
describe('test suite 2 - failing', () => {
|
|
21
|
+
it('should fail', () => {
|
|
22
|
+
throw new Error('failing test')
|
|
23
|
+
})
|
|
24
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default 'polendina test'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fixture-tape",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "test fixture",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "tape test.js"
|
|
9
|
+
},
|
|
10
|
+
"author": "Rod <rod@vagg.org> (http://r.va.gg/)",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/rvagg/polendina.git"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"tape": "~5.3.2"
|
|
18
|
+
}
|
|
19
|
+
}
|