polendina 1.0.1 → 2.0.0-alpha2

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.
Files changed (89) hide show
  1. package/.github/dependabot.yml +154 -0
  2. package/.github/workflows/test-and-release.yml +61 -0
  3. package/lib/log.js +8 -8
  4. package/lib/puppeteer.js +3 -5
  5. package/lib/webpack.config.js +15 -18
  6. package/lib/{wrap-loader.js → wrap-loader.cjs} +10 -7
  7. package/package.json +99 -18
  8. package/polendina-cli.js +7 -6
  9. package/polendina-node-cli.js +10 -6
  10. package/polendina.js +48 -22
  11. package/resources/bare-run.js +3 -3
  12. package/resources/bare.js +7 -5
  13. package/resources/common-run.js +23 -26
  14. package/resources/mocha-run.js +12 -12
  15. package/resources/tape-run.js +5 -5
  16. package/resources/test-registry.js +4 -1
  17. package/test/common.js +8 -8
  18. package/test/fixtures/bare-async/package.json +4 -1
  19. package/test/fixtures/bare-async/test-1.js +1 -1
  20. package/test/fixtures/bare-async/test-2.js +1 -1
  21. package/test/fixtures/bare-async-esm/index.js +3 -0
  22. package/test/fixtures/bare-async-esm/package.json +19 -0
  23. package/test/fixtures/bare-async-esm/test-1.js +16 -0
  24. package/test/fixtures/bare-async-esm/test-2.js +11 -0
  25. package/test/fixtures/bare-async-failure/package.json +4 -1
  26. package/test/fixtures/bare-async-failure/test-1.js +1 -1
  27. package/test/fixtures/bare-async-failure/test-2.js +2 -2
  28. package/test/fixtures/bare-async-failure-esm/index.js +3 -0
  29. package/test/fixtures/bare-async-failure-esm/package.json +19 -0
  30. package/test/fixtures/bare-async-failure-esm/test-1.js +16 -0
  31. package/test/fixtures/bare-async-failure-esm/test-2.js +11 -0
  32. package/test/fixtures/bare-sync/package.json +4 -1
  33. package/test/fixtures/bare-sync/test-1.js +1 -1
  34. package/test/fixtures/bare-sync/test-2.js +2 -1
  35. package/test/fixtures/bare-sync-esm/index.js +1 -0
  36. package/test/fixtures/bare-sync-esm/package.json +19 -0
  37. package/test/fixtures/bare-sync-esm/test-1.js +14 -0
  38. package/test/fixtures/bare-sync-esm/test-2.js +7 -0
  39. package/test/fixtures/bare-sync-failure/package.json +4 -1
  40. package/test/fixtures/bare-sync-failure/test-1.js +1 -1
  41. package/test/fixtures/bare-sync-failure/test-2.js +2 -2
  42. package/test/fixtures/bare-sync-failure-esm/index.js +1 -0
  43. package/test/fixtures/bare-sync-failure-esm/package.json +19 -0
  44. package/test/fixtures/bare-sync-failure-esm/test-1.js +14 -0
  45. package/test/fixtures/bare-sync-failure-esm/test-2.js +6 -0
  46. package/test/fixtures/mocha/package.json +2 -1
  47. package/test/fixtures/mocha/test-1.js +1 -1
  48. package/test/fixtures/mocha/test-2.js +1 -1
  49. package/test/fixtures/mocha/test-3.js +1 -1
  50. package/test/fixtures/mocha-esm/index.js +1 -0
  51. package/test/fixtures/mocha-esm/package.json +20 -0
  52. package/test/fixtures/mocha-esm/test-1.js +14 -0
  53. package/test/fixtures/mocha-esm/test-2.js +19 -0
  54. package/test/fixtures/mocha-esm/test-3.js +14 -0
  55. package/test/fixtures/mocha-failure/package.json +2 -1
  56. package/test/fixtures/mocha-failure/test.js +1 -1
  57. package/test/fixtures/mocha-failure-esm/package.json +20 -0
  58. package/test/fixtures/mocha-failure-esm/test.js +24 -0
  59. package/test/fixtures/tape/package.json +1 -1
  60. package/test/fixtures/tape-esm/build/bundle.js +12790 -0
  61. package/test/fixtures/tape-esm/build/bundle.js.map +1 -0
  62. package/test/fixtures/tape-esm/build/common-run.js +108 -0
  63. package/test/fixtures/tape-esm/build/index.html +10 -0
  64. package/test/fixtures/tape-esm/build/page-run.js +46 -0
  65. package/test/fixtures/tape-esm/build/tape-run.js +39 -0
  66. package/test/fixtures/tape-esm/build/test-registry.js +6 -0
  67. package/test/fixtures/tape-esm/index.js +1 -0
  68. package/test/fixtures/tape-esm/package.json +19 -0
  69. package/test/fixtures/tape-esm/test.js +47 -0
  70. package/test/fixtures/tape-failure/build/bundle.js +12646 -0
  71. package/test/fixtures/tape-failure/build/bundle.js.map +1 -0
  72. package/test/fixtures/tape-failure/build/common-run.js +108 -0
  73. package/test/fixtures/tape-failure/build/index.html +10 -0
  74. package/test/fixtures/tape-failure/build/page-run.js +46 -0
  75. package/test/fixtures/tape-failure/build/tape-run.js +39 -0
  76. package/test/fixtures/tape-failure/build/test-registry.js +6 -0
  77. package/test/fixtures/tape-failure/package.json +1 -1
  78. package/test/fixtures/tape-failure-esm/package.json +19 -0
  79. package/test/fixtures/tape-failure-esm/test.js +29 -0
  80. package/test/fixtures/webpack-merge/package.json +4 -1
  81. package/test/fixtures/webpack-merge/test.js +3 -4
  82. package/test/fixtures/webpack-merge/webpack.config.js +3 -3
  83. package/test/test-bare-async.js +92 -87
  84. package/test/test-bare-sync.js +92 -87
  85. package/test/test-mocha.js +101 -96
  86. package/test/test-polendina-node.js +44 -38
  87. package/test/test-tape.js +99 -94
  88. package/test/test-webpack-merge.js +11 -9
  89. package/.github/workflows/main.yml +0 -21
@@ -0,0 +1 @@
1
+ export default 'polendina test'
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "fixture-mocha",
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,14 @@
1
+ /* globals describe it */
2
+
3
+ import fixture from './index.js'
4
+ import { assert } from 'chai'
5
+
6
+ describe('test suite 1', () => {
7
+ it('test case 1', () => {
8
+ assert.strictEqual(fixture, 'polendina test')
9
+ })
10
+
11
+ it('test case 2', () => {
12
+ assert.ok(true, 'all good')
13
+ })
14
+ })
@@ -0,0 +1,19 @@
1
+ /* globals describe it WorkerGlobalScope ServiceWorkerGlobalScope */
2
+
3
+ import { assert } from 'chai'
4
+
5
+ describe('test suite 2 - worker', () => {
6
+ if (typeof ServiceWorkerGlobalScope !== 'undefined' && global instanceof ServiceWorkerGlobalScope) {
7
+ it('is in serviceworker', () => {
8
+ assert.strictEqual(typeof ServiceWorkerGlobalScope, 'function')
9
+ })
10
+ } else if (typeof WorkerGlobalScope !== 'undefined' && global instanceof WorkerGlobalScope) {
11
+ it('is in worker', () => {
12
+ assert.strictEqual(typeof WorkerGlobalScope, 'function')
13
+ })
14
+ } else {
15
+ it('is not in worker', () => {
16
+ assert.strictEqual(typeof WorkerGlobalScope, 'undefined')
17
+ })
18
+ }
19
+ })
@@ -0,0 +1,14 @@
1
+ /* globals describe it */
2
+
3
+ import fixture from './index.js'
4
+ import { assert } from 'chai'
5
+
6
+ describe('test suite 3', () => {
7
+ it('test case 1', () => {
8
+ assert.strictEqual(fixture, 'polendina test')
9
+ })
10
+
11
+ it('test case 2', () => {
12
+ assert.ok(true, 'all good')
13
+ })
14
+ })
@@ -13,6 +13,7 @@
13
13
  "url": "https://github.com/rvagg/polendina.git"
14
14
  },
15
15
  "devDependencies": {
16
- "mocha": "^7.0.0"
16
+ "chai": "^4.3.4",
17
+ "mocha": "~9.1.3"
17
18
  }
18
19
  }
@@ -1,5 +1,5 @@
1
1
  /* globals describe it WorkerGlobalScope ServiceWorkerGlobalScope */
2
- const assert = require('assert')
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
+ })
@@ -13,6 +13,6 @@
13
13
  "url": "https://github.com/rvagg/polendina.git"
14
14
  },
15
15
  "devDependencies": {
16
- "tape": "^4.12.1"
16
+ "tape": "~5.3.2"
17
17
  }
18
18
  }