polendina 3.2.0 → 3.2.2
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/workflows/test-and-release.yml +2 -2
- package/CHANGELOG.md +14 -0
- package/lib/wrap-loader.cjs +4 -4
- package/package.json +12 -9
- package/polendina.js +1 -1
- package/resources/common-run.js +1 -1
- package/resources/mocha-run.js +2 -2
- package/resources/tape-run.js +2 -2
- package/resources/test-registry.cjs +6 -0
- package/test/common.js +1 -1
- package/test/fixtures/bare-async/test/test-3.js +11 -0
- package/test/fixtures/bare-async-esm/test/test-3.js +11 -0
- package/test/fixtures/bare-sync/test/test-3.js +6 -0
- package/test/fixtures/bare-sync/test-2.js +0 -1
- package/test/fixtures/bare-sync-esm/test/test-3.js +6 -0
- package/test/fixtures/bare-sync-esm/test-2.js +0 -1
- package/test/test-bare-async.js +4 -0
- package/test/test-bare-sync.js +2 -0
- package/resources/test-registry.js +0 -6
|
@@ -12,7 +12,7 @@ jobs:
|
|
|
12
12
|
- name: Checkout Repository
|
|
13
13
|
uses: actions/checkout@v3
|
|
14
14
|
- name: Use Node.js ${{ matrix.node }}
|
|
15
|
-
uses: actions/setup-node@
|
|
15
|
+
uses: actions/setup-node@v4.0.4
|
|
16
16
|
with:
|
|
17
17
|
node-version: ${{ matrix.node }}
|
|
18
18
|
- name: Install Dependencies
|
|
@@ -33,7 +33,7 @@ jobs:
|
|
|
33
33
|
with:
|
|
34
34
|
fetch-depth: 0
|
|
35
35
|
- name: Setup Node.js
|
|
36
|
-
uses: actions/setup-node@
|
|
36
|
+
uses: actions/setup-node@v4.0.4
|
|
37
37
|
with:
|
|
38
38
|
node-version: lts/*
|
|
39
39
|
- name: Install dependencies
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [3.2.2](https://github.com/rvagg/polendina/compare/v3.2.1...v3.2.2) (2024-09-25)
|
|
2
|
+
|
|
3
|
+
### Trivial Changes
|
|
4
|
+
|
|
5
|
+
* **deps:** bump actions/setup-node from 3.5.1 to 4.0.4 ([479fa2a](https://github.com/rvagg/polendina/commit/479fa2a7c5809d19fd5f0e0611307fe228ce2313))
|
|
6
|
+
* update deps ([488fd9c](https://github.com/rvagg/polendina/commit/488fd9caca279a8c07d6a17cde2f5b81d8066d78))
|
|
7
|
+
|
|
8
|
+
## [3.2.1](https://github.com/rvagg/polendina/compare/v3.2.0...v3.2.1) (2023-05-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* properly handle subdirectories & relative directory tests ([4ea4a50](https://github.com/rvagg/polendina/commit/4ea4a5011385abdff614f2602e9be6be8cdd1d47))
|
|
14
|
+
|
|
1
15
|
## [3.2.0](https://github.com/rvagg/polendina/compare/v3.1.0...v3.2.0) (2023-05-15)
|
|
2
16
|
|
|
3
17
|
|
package/lib/wrap-loader.cjs
CHANGED
|
@@ -19,13 +19,13 @@ wrapLoader.pitch = function pitch (remainingRequest) {
|
|
|
19
19
|
|
|
20
20
|
// wrap the test in a function that is only called when we want it called
|
|
21
21
|
return `
|
|
22
|
-
|
|
22
|
+
const { registry } = require('./${path.relative(path.dirname(remainingRequest), path.resolve(argv.outputDir, 'test-registry.cjs')).replace(/\\/g, '/')}')
|
|
23
23
|
registry.argv = JSON.parse(${JSON.stringify(JSON.stringify(argv))})
|
|
24
24
|
registry.tests.push({
|
|
25
|
-
name: JSON.parse('${JSON.stringify(path.normalize(path.relative(process.cwd(), remainingRequest))).replace(
|
|
26
|
-
load: () => { return require(${JSON.stringify(
|
|
25
|
+
name: JSON.parse('${JSON.stringify(path.normalize(path.relative(process.cwd(), remainingRequest))).replace(/\\+/g, '/')}'),
|
|
26
|
+
load: () => { return require(${JSON.stringify(`!!./${path.basename(remainingRequest)}`)}) }
|
|
27
27
|
})
|
|
28
|
-
|
|
28
|
+
module.exports = {}
|
|
29
29
|
`
|
|
30
30
|
}
|
|
31
31
|
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polendina",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "Non-UI browser testing for JavaScript libraries from the command-line",
|
|
5
5
|
"main": "polendina.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"ansi-colors": "^4.1.3",
|
|
9
|
-
"glob": "^
|
|
9
|
+
"glob": "^11.0.0",
|
|
10
10
|
"path-browserify": "^1.0.1",
|
|
11
11
|
"process": "^0.11.10",
|
|
12
|
-
"puppeteer": "^
|
|
12
|
+
"puppeteer": "^23.4.0",
|
|
13
13
|
"raw-loader": "^4.0.2",
|
|
14
|
-
"readable-stream": "^4.
|
|
15
|
-
"rimraf": "^
|
|
14
|
+
"readable-stream": "^4.5.2",
|
|
15
|
+
"rimraf": "^6.0.1",
|
|
16
16
|
"st": "^3.0.0",
|
|
17
17
|
"stream-browserify": "^3.0.0",
|
|
18
|
-
"strip-ansi": "^7.0
|
|
19
|
-
"webpack": "^5.
|
|
20
|
-
"webpack-merge": "^
|
|
18
|
+
"strip-ansi": "^7.1.0",
|
|
19
|
+
"webpack": "^5.94.0",
|
|
20
|
+
"webpack-merge": "^6.0.1",
|
|
21
21
|
"yargs": "^17.7.2"
|
|
22
22
|
},
|
|
23
23
|
"bin": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"polendina-node": "./polendina-node-cli.js"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"lint": "
|
|
28
|
+
"lint": "standard",
|
|
29
29
|
"test:install": "for f in $(cd test/fixtures/; ls); do (cd test/fixtures/$f && grep devDependencies package.json > /dev/null && npm i --no-audit --no-fund --no-package-lock) || true; done",
|
|
30
30
|
"test:run": "npm_config_yes=true npx mocha test/test-*.js",
|
|
31
31
|
"test": "npm run lint && npm run test:install && npm run test:run"
|
|
@@ -126,5 +126,8 @@
|
|
|
126
126
|
"@semantic-release/github",
|
|
127
127
|
"@semantic-release/git"
|
|
128
128
|
]
|
|
129
|
+
},
|
|
130
|
+
"devDependencies": {
|
|
131
|
+
"standard": "^17.1.2"
|
|
129
132
|
}
|
|
130
133
|
}
|
package/polendina.js
CHANGED
|
@@ -63,7 +63,7 @@ export class Polendina {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
await fs.promises.mkdir(this.outputDir, { recursive: true })
|
|
66
|
-
const copyFiles = ['index.html', 'test-registry.
|
|
66
|
+
const copyFiles = ['index.html', 'test-registry.cjs', 'page-run.js', 'common-run.js', this._runnerModule]
|
|
67
67
|
if (this._options.runner.startsWith('bare-')) {
|
|
68
68
|
copyFiles.push('bare.js')
|
|
69
69
|
}
|
package/resources/common-run.js
CHANGED
package/resources/mocha-run.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import mochaExport from 'mocha/mocha.js'
|
|
4
4
|
import { registry, executionQueue, log, setup } from './common-run.js'
|
|
5
5
|
|
|
6
|
-
function runMocha () {
|
|
6
|
+
async function runMocha () {
|
|
7
7
|
// mocha@8 exports what we want, mocha@7 sets a global
|
|
8
8
|
const mochaLocal = mochaExport
|
|
9
9
|
mochaLocal.setup({ reporter: registry.argv.mochaReporter, ui: 'bdd' })
|
|
@@ -18,7 +18,7 @@ function runMocha () {
|
|
|
18
18
|
mochaLocal.constructor.reporters.Base.consoleLog = log.info
|
|
19
19
|
|
|
20
20
|
for (const mod of registry.tests) {
|
|
21
|
-
mod.load()
|
|
21
|
+
await mod.load()
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
let errors = 0
|
package/resources/tape-run.js
CHANGED
|
@@ -4,7 +4,7 @@ import tape from 'tape'
|
|
|
4
4
|
import { registry, setup, executionQueue } from './common-run.js'
|
|
5
5
|
import { Transform } from 'stream'
|
|
6
6
|
|
|
7
|
-
function runTape () {
|
|
7
|
+
async function runTape () {
|
|
8
8
|
let failures = 0
|
|
9
9
|
|
|
10
10
|
const stream = new Transform({
|
|
@@ -32,7 +32,7 @@ function runTape () {
|
|
|
32
32
|
})
|
|
33
33
|
|
|
34
34
|
for (const mod of registry.tests) {
|
|
35
|
-
mod.load()
|
|
35
|
+
await mod.load()
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
package/test/common.js
CHANGED
|
@@ -7,7 +7,7 @@ const __dirname = fileURLToPath(path.dirname(import.meta.url))
|
|
|
7
7
|
const cli = path.join(__dirname, '../polendina-cli.js')
|
|
8
8
|
|
|
9
9
|
export async function runCli (cwd, args) {
|
|
10
|
-
return runCommand(`${cli} test*.js --cleanup ${args || ''}`, cwd)
|
|
10
|
+
return runCommand(`${cli} test*.js test/test*.js --cleanup ${args || ''}`, cwd)
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export async function runCommand (command, cwd) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const { assert } = require('chai')
|
|
2
|
+
const index = require('../')
|
|
3
|
+
|
|
4
|
+
module.exports.test1 = async function () {
|
|
5
|
+
console.log('testing bare fixture subdir')
|
|
6
|
+
assert.strictEqual(await index(), 'bare test fixture')
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
module.exports.test2 = async function () {
|
|
10
|
+
assert.ok(true, 'yep')
|
|
11
|
+
}
|
|
@@ -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 subdir')
|
|
6
|
+
assert.strictEqual(await index(), 'bare test fixture')
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export async function test2 () {
|
|
10
|
+
assert.ok(true, 'yep')
|
|
11
|
+
}
|
package/test/test-bare-async.js
CHANGED
package/test/test-bare-sync.js
CHANGED