fix(core): update
This commit is contained in:
parent
a849f36a1b
commit
4aa731b531
27
package-lock.json
generated
27
package-lock.json
generated
@ -1567,16 +1567,31 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/tapbundle": {
|
"@pushrocks/tapbundle": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.7",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.2.1.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.2.7.tgz",
|
||||||
"integrity": "sha512-D3o205SE+Viu8sukm+6CvGkXEwOiQiEEcga9eWyvjWS4vDx6FWwrO0pNZkQq6GqsKQ9xRpCmBtI7F3KsJR0+PA==",
|
"integrity": "sha512-RBRjuJs3v/biKypc9rSecApn7IXRdmr/jbVH86+2mDxyzUQ8IcMhaKhUrIjKoNyvxvMAMS2j+OxPyiOCnK6RAw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/early": "^3.0.3",
|
"@pushrocks/smartdelay": "^2.0.9",
|
||||||
"@pushrocks/smartdelay": "^2.0.3",
|
"@pushrocks/smartenv": "^4.0.10",
|
||||||
"@pushrocks/smartfile": "^7.0.9",
|
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
|
"@pushrocks/smarttime": "^3.0.19",
|
||||||
"smartchai": "^2.0.1"
|
"smartchai": "^2.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@pushrocks/smarttime": {
|
||||||
|
"version": "3.0.19",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.19.tgz",
|
||||||
|
"integrity": "sha512-1iSkNJcF632Mikcd/EvcBPC1T5tLRZqTHjVkuZlXpaNY11eZIzYVMOn5/ZDfLp2GuEi6hhIbEx9zwsdoYqz5cA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@pushrocks/smartdelay": "^2.0.9",
|
||||||
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
|
"croner": "^1.1.23",
|
||||||
|
"dayjs": "^1.8.27",
|
||||||
|
"is-nan": "^1.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/webrequest": {
|
"@pushrocks/webrequest": {
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.17",
|
"@gitzone/tsbuild": "^2.1.17",
|
||||||
"@pushrocks/tapbundle": "^3.0.13",
|
"@pushrocks/tapbundle": "^3.2.7",
|
||||||
"tslint": "^6.1.2",
|
"tslint": "^6.1.2",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
|
@ -115,42 +115,6 @@ export class TsTest {
|
|||||||
const evaluation = await this.smartbrowserInstance.evaluateOnPage(
|
const evaluation = await this.smartbrowserInstance.evaluateOnPage(
|
||||||
`http://localhost:3007/test?bundleName=${bundleFileName}`,
|
`http://localhost:3007/test?bundleName=${bundleFileName}`,
|
||||||
async () => {
|
async () => {
|
||||||
let logStore = 'Starting log capture\n';
|
|
||||||
// tslint:disable-next-line: max-classes-per-file
|
|
||||||
class Deferred<T> {
|
|
||||||
public promise: Promise<T>;
|
|
||||||
public resolve;
|
|
||||||
public reject;
|
|
||||||
public status;
|
|
||||||
|
|
||||||
public startedAt: number;
|
|
||||||
public stoppedAt: number;
|
|
||||||
public get duration(): number {
|
|
||||||
if (this.stoppedAt) {
|
|
||||||
return this.stoppedAt - this.startedAt;
|
|
||||||
} else {
|
|
||||||
return Date.now() - this.startedAt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this.promise = new Promise<T>((resolve, reject) => {
|
|
||||||
this.resolve = (valueArg: T | PromiseLike<T>) => {
|
|
||||||
this.status = 'fulfilled';
|
|
||||||
this.stoppedAt = Date.now();
|
|
||||||
resolve(valueArg);
|
|
||||||
};
|
|
||||||
this.reject = (reason: any) => {
|
|
||||||
this.status = 'rejected';
|
|
||||||
this.stoppedAt = Date.now();
|
|
||||||
reject(reason);
|
|
||||||
};
|
|
||||||
this.startedAt = Date.now();
|
|
||||||
this.status = 'pending';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const done = new Deferred();
|
|
||||||
const convertToText = (obj) => {
|
const convertToText = (obj) => {
|
||||||
// create an array that will later be joined into a string.
|
// create an array that will later be joined into a string.
|
||||||
const stringArray = [];
|
const stringArray = [];
|
||||||
@ -181,6 +145,9 @@ export class TsTest {
|
|||||||
|
|
||||||
return stringArray.join('');
|
return stringArray.join('');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let logStore = 'Starting log capture\n';
|
||||||
|
// tslint:disable-next-line: max-classes-per-file
|
||||||
const log = console.log.bind(console);
|
const log = console.log.bind(console);
|
||||||
console.log = (...args) => {
|
console.log = (...args) => {
|
||||||
args = args.map((argument) => {
|
args = args.map((argument) => {
|
||||||
@ -204,15 +171,15 @@ export class TsTest {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
|
||||||
console.log(globalThis.testdom);
|
if (globalThis.tapbundleDeferred && globalThis.tapbundleDeferred.promise) {
|
||||||
done.resolve();
|
await globalThis.tapbundleDeferred.promise;
|
||||||
}, 5000);
|
} else {
|
||||||
await done.promise;
|
console.log('Error: Could not find tapbundle Deferred');
|
||||||
|
}
|
||||||
return logStore;
|
return logStore;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
await plugins.smartdelay.delayFor(1000);
|
|
||||||
await this.smartbrowserInstance.stop();
|
await this.smartbrowserInstance.stop();
|
||||||
console.log(`${cs('=> ', 'blue')} Stopped ${cs(fileNameArg, 'orange')} chromium instance.`);
|
console.log(`${cs('=> ', 'blue')} Stopped ${cs(fileNameArg, 'orange')} chromium instance.`);
|
||||||
await server.stop();
|
await server.stop();
|
||||||
|
Loading…
Reference in New Issue
Block a user