@lumjs/tests 1.8.1 → 1.9.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.
package/CHANGELOG.md CHANGED
@@ -11,6 +11,15 @@ and a reference to a property of a module will be in `@tests.propName` format.
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [1.9.0] - 2024-07-27
15
+ ### Changed
16
+ - Renamed `Harness` constructor name to `LumTestsHarness` to be more unique.
17
+ - The `Stats` class no longer requires the `../harness` module, but instead
18
+ checks if the object instance's constructor name is `LumTestsHarness`.
19
+ This will allow the `test` and `test/functional` modules to be bundled
20
+ by Webpack without bundling `harness` which currently has some issues.
21
+ - Minor bug fixes from `1.8.1` and `1.8.2` unlisted releases.
22
+
14
23
  ## [1.8.0] - 2023-01-06
15
24
  ### Changed
16
25
  - Bumped `@lumjs/core` to `1.8.0`.
@@ -140,7 +149,8 @@ and a reference to a property of a module will be in `@tests.propName` format.
140
149
  - Ported from Lum.js v4 library set.
141
150
  - Added a few more features from the PHP version.
142
151
 
143
- [Unreleased]: https://github.com/supernovus/lum.tests.js/compare/v1.8.0...HEAD
152
+ [Unreleased]: https://github.com/supernovus/lum.tests.js/compare/v1.9.0...HEAD
153
+ [1.9.0]: https://github.com/supernovus/lum.tests.js/compare/v1.8.0...v1.9.0
144
154
  [1.8.0]: https://github.com/supernovus/lum.tests.js/compare/v1.7.1...v1.8.0
145
155
  [1.7.1]: https://github.com/supernovus/lum.tests.js/compare/v1.7.0...v1.7.1
146
156
  [1.7.0]: https://github.com/supernovus/lum.tests.js/compare/v1.6.0...v1.7.0
package/TODO.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # TODO
2
2
 
3
+ - Update to properly support `async` tests; the `harness` will need some work.
3
4
  - Write tests for:
4
5
  - `call()`
5
6
  - `diesWith()`
@@ -33,7 +33,7 @@ const Plugin = require('./plugin');
33
33
  *
34
34
  * @exports module:@lumjs/tests/harness
35
35
  */
36
- class Harness
36
+ class LumTestsHarness
37
37
  {
38
38
  /**
39
39
  * Build a new Harness
@@ -248,12 +248,12 @@ class Harness
248
248
 
249
249
  } // Harness class
250
250
 
251
- def(Harness, 'Plugin', Plugin);
252
- def(Harness, 'QueuedTest', QueuedTest);
253
- def(Harness, 'Errors', require('./errors'));
251
+ def(LumTestsHarness, 'Plugin', Plugin);
252
+ def(LumTestsHarness, 'QueuedTest', QueuedTest);
253
+ def(LumTestsHarness, 'Errors', require('./errors'));
254
254
 
255
255
  // Export it.
256
- module.exports = Harness;
256
+ module.exports = LumTestsHarness;
257
257
 
258
258
  // Some classes required at end for recursive sanity reasons.
259
259
 
package/lib/test/stats.js CHANGED
@@ -100,8 +100,9 @@ class Stats
100
100
  }
101
101
 
102
102
  if (!this.isTop)
103
- { // Try to find a Harness instance.
104
- if (isObj(require.main) && require.main.exports instanceof Harness)
103
+ { // Try to find a possible Harness instance using some obscure logic...
104
+ if (isObj(require.main) && isObj(require.main.exports)
105
+ && require.main.exports.constructor.name === 'LumTestsHarness')
105
106
  { // We found the Harness instance.
106
107
  this.harness = require.main.exports;
107
108
  }
@@ -380,7 +381,3 @@ class Stats
380
381
 
381
382
  // Export the class
382
383
  module.exports = Stats;
383
-
384
- // Finally at the bottom after `module.exports` has been set, we will load
385
- // the Harness class to avoid circular references failing.
386
- const Harness = require('../harness');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumjs/tests",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "main": "lib/index.js",
5
5
  "bin":
6
6
  {
@@ -27,7 +27,7 @@
27
27
  "@lumjs/core": "^1.8.0"
28
28
  },
29
29
  "scripts": {
30
- "test": "lumtest.js",
30
+ "test": "./bin/lumtest.js",
31
31
  "build-docs": "jsdoc -c ./jsdoc.json",
32
32
  "build": "npm run build:grammar",
33
33
  "build:grammar": "./bin/build-grammar.sh tap"