qunitx-cli 0.0.3 → 0.1.0

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.
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ # Maintain dependencies for GitHub Actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "daily"
@@ -0,0 +1,36 @@
1
+ name: docker-based-ci
2
+ on: push
3
+ jobs:
4
+ test:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - name: Checkout
8
+ uses: actions/checkout@v3
9
+ - name: Set ENV variables
10
+ run: |
11
+ echo "REGISTRY=ghcr.io" >> $GITHUB_ENV
12
+ echo "REPO_OWNER=$(echo ${GITHUB_REPOSITORY%/*})" >> $GITHUB_ENV
13
+ echo "REPO_NAME=$(echo ${GITHUB_REPOSITORY#*/})" >> $GITHUB_ENV
14
+ echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
15
+ echo "DOCKER_TAG=$(echo ${GITHUB_REPOSITORY#*/}):$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
16
+ - name: Set up Docker Buildx
17
+ uses: docker/setup-buildx-action@v2.9.0
18
+ with:
19
+ install: true
20
+ - name: Login to GitHub Container Registry
21
+ uses: docker/login-action@v2.2.0
22
+ with:
23
+ registry: ${{env.REGISTRY}}
24
+ username: ${{env.REPO_OWNER}}
25
+ password: ${{secrets.CR_PAT}}
26
+ - name: Build and push
27
+ uses: docker/build-push-action@v4.1.1
28
+ with:
29
+ context: .
30
+ file: ./Dockerfile
31
+ push: true
32
+ tags: ${{env.REGISTRY}}/${{env.REPO_OWNER}}/${{env.DOCKER_TAG}}
33
+ cache-from: type=gha
34
+ cache-to: type=gha,mode=max
35
+ - name: Execute tests
36
+ run: docker run -t --entrypoint="npm" ${REGISTRY}/${REPO_OWNER}/${DOCKER_TAG} run test
package/CHANGELOG.md CHANGED
@@ -4,8 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [0.1.0](https://github.com/izelnakri/qunitx-cli/compare/0.0.3...0.1.0)
8
+
9
+ - pkg upgrades & github CI [`7a33c07`](https://github.com/izelnakri/qunitx-cli/commit/7a33c07ef9c7b404458ac8b46f97c11009fe32fa)
10
+ - remove --browser flag from help [`011c5ae`](https://github.com/izelnakri/qunitx-cli/commit/011c5aecb1e293bb57aa396d7ceac0fca349298f)
11
+ - add TODO [`35a5121`](https://github.com/izelnakri/qunitx-cli/commit/35a512135d9b5abab740bfde9ae6ecb1781ab26b)
12
+
7
13
  #### [0.0.3](https://github.com/izelnakri/qunitx-cli/compare/0.0.2...0.0.3)
8
14
 
15
+ > 13 July 2023
16
+
17
+ - Release 0.0.3 [`0379477`](https://github.com/izelnakri/qunitx-cli/commit/037947750cc372bdd5c45389d78131bd0b8fa51e)
9
18
  - built the foundation for development [`569d860`](https://github.com/izelnakri/qunitx-cli/commit/569d8606b75287aceeaaf0b711139650182cd6c4)
10
19
 
11
20
  #### 0.0.2
package/TODO ADDED
@@ -0,0 +1,90 @@
1
+ - "$ qunitx sanity-test.ts" made redundant due to (node --test mode) this should impact dependencies and internal modules
2
+ - Implement other test cases in deno
3
+
4
+ Shim dir structure should be: shims/nodejs/ shims/deno shims/browser
5
+ Make package.json point to them correctly
6
+ Make the package so esbuild build so esbuild builds when qunitx is vendored(if it needs to)
7
+
8
+ Turn import { module, test } from '../../shims/nodejs.js' to import { module, test } from 'qunitx'; For this to happen browser bundler should pick up actual qunit
9
+
10
+ Combine nix with Docker for faster container builds
11
+
12
+ - also watch subdependencies on browser mode (-- how? investigate esbuild watch)
13
+ - maybe make browser tests per file loading <script>, also could add asset maps maybe if puppeteer supports, this could fix initial "qf" bug
14
+
15
+ implement and test require and timeout flags
16
+ implement concurrency
17
+
18
+ fix watcher for file removals make the logic smarter
19
+
20
+ allow passing absolutePaths(maybe)
21
+
22
+ - globs: test dynamically added file is watched on global input configuration | also check added files on watch gets put to config.fileOrFolderInputs
23
+ currently parse-fs-inputs might be less performant on big folders(?) dependending on how watch is implemented
24
+ - coverage
25
+ watch parsed files from html(?)
26
+
27
+
28
+ $ qunitx some-test --browser | default html doesnt match with $ qunitx init and also no html mode should be there
29
+
30
+ try this: $ npx ava --tap | npx tap-difflet
31
+ or this: $ npx ava --tap | npx faucet
32
+
33
+ research mocha reporter(TAP > reporters | json stream metada then it consumes this metadata(how?))
34
+ example good reporters: spec(reporter), dot, tap, landing strip(interesting instead put percentage), jest
35
+
36
+ esbuild ./tmp/test/passing-tests.js --bundle > test.js
37
+ parse qunitx in the package.json for config
38
+
39
+ failFast and babelOptions?
40
+ files(and to ignore), require, timeout
41
+ concurrencyStrategies
42
+
43
+ add node and browser options
44
+ add functionality to execute only one test
45
+ add reporters
46
+
47
+ pass timezone: https://stackoverflow.com/questions/16448754/how-to-use-a-custom-time-in-browser-to-test-for-client-vs-server-time-difference/39533934#39533934
48
+ = qunitx --timezone="US/Pacific"
49
+
50
+ QUnit regex filters
51
+
52
+ Jest Notes
53
+ ==========
54
+ TestSequencer
55
+ - this failed in the past? run first
56
+ - when file changed latest
57
+ - this test run in the past and was long? long tests run first
58
+ - file size
59
+
60
+ TestScheduler
61
+ - schedule across threads
62
+ - reporters
63
+ - dont spawn many threads if total test count is small
64
+ jest-runner/jest-puppeteer(check this)
65
+
66
+ read jest-worker/worker_thread implementation
67
+
68
+
69
+ check if jest-qunit exists
70
+
71
+ jest-runtime(creates VM context)
72
+ allows module mocking, custom require implementation, also does transforms
73
+ runs the tests
74
+ transform is sync in jest(dep tracking problem)
75
+
76
+ TestResult / Repoter
77
+ - all data has to be json serializable for threads
78
+ - stack trace of errors
79
+ - how many assertions
80
+
81
+ AggregatedRestResult[]
82
+ - finished test case, how long, each assertion
83
+ - check jest runners
84
+
85
+ qunitx init
86
+
87
+
88
+ write test metadata(each test) if flag is provided
89
+
90
+ markdown reporter(interesting: https://mochajs.org/#markdown)
@@ -20,7 +20,6 @@ ${highlight("Input options:")}
20
20
  - Combination: $ ${color('qunitx test/foo.js test/bar.js test/*-test.js test/logout')}
21
21
 
22
22
  ${highlight("Optional flags:")}
23
- ${color('--browser')} : run qunit tests in chromium with puppeteer instead of node.js(which is the default)
24
23
  ${color('--debug')} : print console output when tests run in browser
25
24
  ${color('--watch')} : run the target file or folders, watch them for continuous run and expose http server under localhost
26
25
  ${color('--timeout')} : change default timeout per test case
@@ -29,7 +28,7 @@ ${color('--failFast')} : run the target file or folders with immediate abort if
29
28
  ${color('--before')} : run a script before the tests(i.e start a new web server before tests)
30
29
  ${color('--after')} : run a script after the tests(i.e save test results to a file)
31
30
 
32
- ${highlight("Example:")} $ ${color('qunitx test/foo.ts app/e2e --browser --debug --watch --before=scripts/start-new-webserver.js --after=scripts/write-test-results.js')}
31
+ ${highlight("Example:")} $ ${color('qunitx test/foo.ts app/e2e --debug --watch --before=scripts/start-new-webserver.js --after=scripts/write-test-results.js')}
33
32
 
34
33
  ${highlight("Commands:")}
35
34
  ${color('$ qunitx init')} # Bootstraps qunitx base html and add qunitx config to package.json if needed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qunitx-cli",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.1.0",
5
5
  "description": "Browser runner for QUnitx: run your qunitx tests in google-chrome",
6
6
  "main": "index.js",
7
7
  "author": "Izel Nakri",
@@ -23,7 +23,10 @@
23
23
  "prepack": "npm run build",
24
24
  "release:alpha": "node_modules/.bin/release-it --preRelease=alpha --no-git.requireUpstream",
25
25
  "release:beta": "node_modules/.bin/release-it --preRelease=beta --no-git.requireUpstream",
26
- "release": "node_modules/.bin/release-it"
26
+ "release": "node_modules/.bin/release-it",
27
+ "test": "node --test test/index.js",
28
+ "test:sanity-first": "./cli.js test/helpers/failing-tests.js test/helpers/failing-tests.ts",
29
+ "test:sanity-second": "./cli.js test/helpers/passing-tests.js test/helpers/passing-tests.ts"
27
30
  },
28
31
  "engines": {
29
32
  "node": ">=20.3.0"
@@ -38,12 +41,12 @@
38
41
  "dependencies": {
39
42
  "cheerio": "^1.0.0-rc.10",
40
43
  "chokidar": "^3.5.3",
41
- "esbuild": "^0.18.12",
44
+ "esbuild": "^0.18.14",
42
45
  "js-yaml": "^4.1.0",
43
46
  "jsdom": "^22.0.0",
44
47
  "kleur": "^4.1.5",
45
48
  "picomatch": "^2.3.1",
46
- "puppeteer": "20.8.2",
49
+ "puppeteer": "20.8.3",
47
50
  "recursive-lookup": "1.1.0",
48
51
  "ws": "^8.13.0"
49
52
  },
@@ -54,7 +57,7 @@
54
57
  "prettier": "^3.0.0",
55
58
  "qunit": "^2.19.4",
56
59
  "qunitx": "^0.6.0",
57
- "release-it": "^16.1.0"
60
+ "release-it": "^16.1.2"
58
61
  },
59
62
  "volta": {
60
63
  "node": "20.4.0"
@@ -24,7 +24,6 @@ Input options:
24
24
  - Combination: $ qunitx test/foo.js test/bar.js test/*-test.js test/logout
25
25
 
26
26
  Optional flags:
27
- --browser : run qunit tests in chromium with puppeteer instead of node.js(which is the default)
28
27
  --debug : print console output when tests run in browser
29
28
  --watch : run the target file or folders, watch them for continuous run and expose http server under localhost
30
29
  --timeout : change default timeout per test case
@@ -33,7 +32,7 @@ Optional flags:
33
32
  --before : run a script before the tests(i.e start a new web server before tests)
34
33
  --after : run a script after the tests(i.e save test results to a file)
35
34
 
36
- Example: $ qunitx test/foo.ts app/e2e --browser --debug --watch --before=scripts/start-new-webserver.js --after=scripts/write-test-results.js
35
+ Example: $ qunitx test/foo.ts app/e2e --debug --watch --before=scripts/start-new-webserver.js --after=scripts/write-test-results.js
37
36
 
38
37
  Commands:
39
38
  $ qunitx init # Bootstraps qunitx base html and add qunitx config to package.json if needed
@@ -3,7 +3,7 @@ import cors from "cors";
3
3
  import kleur from 'kleur';
4
4
  import bindServerToPort from '../../lib/setup/bind-server-to-port.js';
5
5
  import './before-script-basic.js';
6
- import QUnit from '../../index.js';
6
+ import QUnit from 'qunitx';
7
7
 
8
8
  export default async function(config) {
9
9
  console.log('Starting before script with:');
@@ -1,4 +1,4 @@
1
- import { module, test } from '../../index.js';
1
+ import { module, test } from 'qunitx';
2
2
 
3
3
  module('{{moduleName}} Before script web server tests', function(hooks) {
4
4
  test('assert true works', async function (assert) {