@jdeighan/coffee-utils 4.1.3 → 4.1.4

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jdeighan/coffee-utils",
3
3
  "type": "module",
4
- "version": "4.1.3",
4
+ "version": "4.1.4",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -14,9 +14,9 @@ import {debug, debugging, setDebugging} from '@jdeighan/coffee-utils/debug'
14
14
 
15
15
  export class UnitTester
16
16
 
17
- constructor: (whichTest='deepEqual', @fulltest=false) ->
17
+ constructor: (@file='unknown file') ->
18
18
  @hFound = {}
19
- @setWhichTest whichTest
19
+ @whichTest = 'deepEqual'
20
20
  @justshow = false
21
21
  @testing = true
22
22
  @maxLineNum = undef
@@ -180,7 +180,7 @@ export class UnitTester
180
180
  @lineNum = lineNum # set an object property
181
181
 
182
182
  if (lineNum < 0) && process.env.FINALTEST
183
- error "Negative line numbers not allowed in FINALTEST"
183
+ error "Negative line numbers not allowed in FINALTEST in #{@file}"
184
184
 
185
185
  if ! @testing || (@maxLineNum && (lineNum > @maxLineNum))
186
186
  return
@@ -242,9 +242,6 @@ export class UnitTester
242
242
 
243
243
  getLineNum: (lineNum) ->
244
244
 
245
- if @fulltest && (lineNum < 0)
246
- error "UnitTester(): negative line number during full test!!!"
247
-
248
245
  # --- patch lineNum to avoid duplicates
249
246
  while @hFound[lineNum]
250
247
  if lineNum < 0
package/src/UnitTester.js CHANGED
@@ -32,10 +32,10 @@ import {
32
32
 
33
33
  // ---------------------------------------------------------------------------
34
34
  export var UnitTester = class UnitTester {
35
- constructor(whichTest = 'deepEqual', fulltest = false) {
36
- this.fulltest = fulltest;
35
+ constructor(file = 'unknown file') {
36
+ this.file = file;
37
37
  this.hFound = {};
38
- this.setWhichTest(whichTest);
38
+ this.whichTest = 'deepEqual';
39
39
  this.justshow = false;
40
40
  this.testing = true;
41
41
  this.maxLineNum = undef;
@@ -189,7 +189,7 @@ export var UnitTester = class UnitTester {
189
189
  this.initialize();
190
190
  this.lineNum = lineNum; // set an object property
191
191
  if ((lineNum < 0) && process.env.FINALTEST) {
192
- error("Negative line numbers not allowed in FINALTEST");
192
+ error(`Negative line numbers not allowed in FINALTEST in ${this.file}`);
193
193
  }
194
194
  if (!this.testing || (this.maxLineNum && (lineNum > this.maxLineNum))) {
195
195
  return;
@@ -256,9 +256,6 @@ export var UnitTester = class UnitTester {
256
256
 
257
257
  // ........................................................................
258
258
  getLineNum(lineNum) {
259
- if (this.fulltest && (lineNum < 0)) {
260
- error("UnitTester(): negative line number during full test!!!");
261
- }
262
259
  // --- patch lineNum to avoid duplicates
263
260
  while (this.hFound[lineNum]) {
264
261
  if (lineNum < 0) {