watcher: Fix all tests
This commit is contained in:
parent
fe2f6ccca9
commit
b476d23a77
3 changed files with 699 additions and 710 deletions
|
@ -4,7 +4,7 @@
|
|||
"description": "Eltro is a tiny no-dependancy test framework for node",
|
||||
"main": "index.mjs",
|
||||
"scripts": {
|
||||
"test": "node cli.mjs 'test/**/*.test.mjs'",
|
||||
"test": "node cli.mjs \"test/**/*.test.mjs\"",
|
||||
"test:watch": "npm-watch test"
|
||||
},
|
||||
"watch": {
|
||||
|
|
1391
test/watch.test.mjs
1391
test/watch.test.mjs
File diff suppressed because it is too large
Load diff
|
@ -187,6 +187,12 @@ Builder.prototype.getAllDirectories = function() {
|
|||
return walk(this.root)
|
||||
}
|
||||
|
||||
Builder.prototype.delay = function(delay) {
|
||||
return new Promise(res => {
|
||||
setTimeout(res, delay)
|
||||
})
|
||||
}
|
||||
|
||||
export function Counter(res, countTotal, waitForSignal = false) {
|
||||
this._res = res
|
||||
this.counter = 0
|
||||
|
@ -208,6 +214,10 @@ Counter.prototype.waitForCount = function(promise) {
|
|||
})
|
||||
}
|
||||
|
||||
Counter.prototype.updateRes = function(res) {
|
||||
this._res = res
|
||||
}
|
||||
|
||||
Counter.prototype.hasSignal = function() {
|
||||
if (this._gotSignal && this._signal) {
|
||||
this._gotSignal = false
|
||||
|
|
Loading…
Reference in a new issue