sxy-test-runner 1.4.3 → 1.4.4
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/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +0 -2
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/lib/addBasePath.d.ts +3 -0
- package/dist/cli/lib/addBasePath.d.ts.map +1 -0
- package/dist/cli/lib/addBasePath.js.map +1 -0
- package/dist/cli/lib/addExports.d.ts +3 -0
- package/dist/cli/lib/addExports.d.ts.map +1 -0
- package/dist/cli/lib/addExports.js.map +1 -0
- package/dist/cli/lib/applyConfigDefaults.d.ts +3 -0
- package/dist/cli/lib/applyConfigDefaults.d.ts.map +1 -0
- package/dist/cli/lib/applyConfigDefaults.js +1 -1
- package/dist/cli/lib/applyConfigDefaults.js.map +1 -0
- package/dist/cli/lib/buildDependencyTree.d.ts +3 -0
- package/dist/cli/lib/buildDependencyTree.d.ts.map +1 -0
- package/dist/cli/lib/buildDependencyTree.js +0 -1
- package/dist/cli/lib/buildDependencyTree.js.map +1 -0
- package/dist/cli/lib/buildDependencyTrees.d.ts +3 -0
- package/dist/cli/lib/buildDependencyTrees.d.ts.map +1 -0
- package/dist/cli/lib/buildDependencyTrees.js.map +1 -0
- package/dist/cli/lib/defaultConfig.d.ts +3 -0
- package/dist/cli/lib/defaultConfig.d.ts.map +1 -0
- package/dist/cli/lib/defaultConfig.js.map +1 -0
- package/dist/cli/lib/doUserSetup.d.ts +3 -0
- package/dist/cli/lib/doUserSetup.d.ts.map +1 -0
- package/dist/cli/lib/doUserSetup.js.map +1 -0
- package/dist/cli/lib/doUserTeardown.d.ts +3 -0
- package/dist/cli/lib/doUserTeardown.d.ts.map +1 -0
- package/dist/cli/lib/doUserTeardown.js.map +1 -0
- package/dist/cli/lib/findTestFiles.d.ts +3 -0
- package/dist/cli/lib/findTestFiles.d.ts.map +1 -0
- package/dist/cli/lib/findTestFiles.js.map +1 -0
- package/dist/cli/lib/getAllowedFlags.d.ts +3 -0
- package/dist/cli/lib/getAllowedFlags.d.ts.map +1 -0
- package/dist/cli/lib/getAllowedFlags.js.map +1 -0
- package/dist/cli/lib/globArgCombine.d.ts +3 -0
- package/dist/cli/lib/globArgCombine.d.ts.map +1 -0
- package/dist/cli/lib/globArgCombine.js.map +1 -0
- package/dist/cli/lib/injectProperties.d.ts +3 -0
- package/dist/cli/lib/injectProperties.d.ts.map +1 -0
- package/dist/cli/lib/injectProperties.js.map +1 -0
- package/dist/cli/lib/loadConfig.d.ts +3 -0
- package/dist/cli/lib/loadConfig.d.ts.map +1 -0
- package/dist/cli/lib/loadConfig.js.map +1 -0
- package/dist/cli/lib/loadTestFile.d.ts +4 -0
- package/dist/cli/lib/loadTestFile.d.ts.map +1 -0
- package/dist/cli/lib/loadTestFile.js.map +1 -0
- package/dist/cli/lib/loadTestFile.unitTest.js +30 -30
- package/dist/cli/lib/loadTestFileStatic.js +39 -39
- package/dist/cli/lib/loadTestFileStatic.unitTest.js +28 -28
- package/dist/cli/lib/parseCommandLineArguments.d.ts +3 -0
- package/dist/cli/lib/parseCommandLineArguments.d.ts.map +1 -0
- package/dist/cli/lib/parseCommandLineArguments.js.map +1 -0
- package/dist/cli/lib/parseDescribe.d.ts +3 -0
- package/dist/cli/lib/parseDescribe.d.ts.map +1 -0
- package/dist/cli/lib/parseDescribe.js +8 -2
- package/dist/cli/lib/parseDescribe.js.map +1 -0
- package/dist/cli/lib/runDescribe.d.ts +3 -0
- package/dist/cli/lib/runDescribe.d.ts.map +1 -0
- package/dist/cli/lib/runDescribe.js +20 -2
- package/dist/cli/lib/runDescribe.js.map +1 -0
- package/dist/cli/lib/runDescribe.old.unitTest.js +439 -439
- package/dist/cli/lib/runDescribeRun.d.ts +3 -0
- package/dist/cli/lib/runDescribeRun.d.ts.map +1 -0
- package/dist/cli/lib/runDescribeRun.js.map +1 -0
- package/dist/cli/lib/runIt.d.ts +3 -0
- package/dist/cli/lib/runIt.d.ts.map +1 -0
- package/dist/cli/lib/runIt.js.map +1 -0
- package/dist/cli/lib/runTasks.d.ts +3 -0
- package/dist/cli/lib/runTasks.d.ts.map +1 -0
- package/dist/cli/lib/runTasks.js.map +1 -0
- package/dist/cli/lib/runTest-old.js +158 -158
- package/dist/cli/lib/runTest-old.unitTest.js +182 -182
- package/dist/cli/lib/runTest.d.ts +3 -0
- package/dist/cli/lib/runTest.d.ts.map +1 -0
- package/dist/cli/lib/runTest.js.map +1 -0
- package/dist/cli/lib/runTests.d.ts +3 -0
- package/dist/cli/lib/runTests.d.ts.map +1 -0
- package/dist/cli/lib/runTests.js +9 -6
- package/dist/cli/lib/runTests.js.map +1 -0
- package/dist/cli/lib/showTestLoadingError.d.ts +3 -0
- package/dist/cli/lib/showTestLoadingError.d.ts.map +1 -0
- package/dist/cli/lib/showTestLoadingError.js +1 -1
- package/dist/cli/lib/showTestLoadingError.js.map +1 -0
- package/dist/cli/lib/showTestResult.d.ts +3 -0
- package/dist/cli/lib/showTestResult.d.ts.map +1 -0
- package/dist/cli/lib/showTestResult.js +13 -1
- package/dist/cli/lib/showTestResult.js.map +1 -0
- package/dist/cli/lib/timeProfier.d.ts +3 -0
- package/dist/cli/lib/timeProfier.d.ts.map +1 -0
- package/dist/cli/lib/timeProfier.js.map +1 -0
- package/dist/cli/lib/validateConfig.d.ts +3 -0
- package/dist/cli/lib/validateConfig.d.ts.map +1 -0
- package/dist/cli/lib/validateConfig.js.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTests.d.ts +2 -0
- package/dist/cli/lib/watchFilesAndRunTests.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTests.js.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTests.unitTest.js +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.d.ts +3 -0
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.js.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.unitTest.js +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.d.ts +3 -0
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.unitTest.js +1 -1
- package/dist/cli/lib/watchFilesChokidar.d.ts +4 -0
- package/dist/cli/lib/watchFilesChokidar.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesChokidar.js.map +1 -0
- package/dist/cli/lib/watchFilesNodeWatch.d.ts +7 -0
- package/dist/cli/lib/watchFilesNodeWatch.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesNodeWatch.js.map +1 -0
- package/dist/cli/once.d.ts +2 -0
- package/dist/cli/once.d.ts.map +1 -0
- package/dist/cli/once.js.map +1 -0
- package/dist/cli/once.unitTest.js +38 -38
- package/dist/cli/watch.d.ts +2 -0
- package/dist/cli/watch.d.ts.map +1 -0
- package/dist/cli/watch.js.map +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js.map +1 -0
- package/dist/describe-old.js +183 -183
- package/dist/describe.d.ts +3 -0
- package/dist/describe.d.ts.map +1 -0
- package/dist/describe.js.map +1 -0
- package/dist/index.d.ts +2 -7
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/indexNumberToLetters.d.ts +2 -0
- package/dist/indexNumberToLetters.d.ts.map +1 -0
- package/dist/indexNumberToLetters.js.map +1 -0
- package/dist/lib/arrayRemove.d.ts +2 -0
- package/dist/lib/arrayRemove.d.ts.map +1 -0
- package/dist/lib/arrayRemove.js +15 -0
- package/dist/lib/arrayRemove.js.map +1 -0
- package/dist/lib/promiseAllObj.d.ts +2 -0
- package/dist/lib/promiseAllObj.d.ts.map +1 -0
- package/dist/lib/promiseAllObj.js +14 -0
- package/dist/lib/promiseAllObj.js.map +1 -0
- package/dist/output.d.ts +6 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js.map +1 -0
- package/dist/types.d.ts +138 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +6 -3
- package/dist/cli/lib/esmReload.unitTest.js +0 -8
- package/dist/cli/lib/load.js +0 -3
- package/dist/cli/lib/load.unitTest copy.js +0 -7
- package/dist/cli/lib/load.unitTest.js +0 -7
- package/dist/load.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { promises as fs, existsSync } from 'fs';
|
|
2
2
|
import figures from 'figures';
|
|
3
|
-
import objectCopy from 'sxy-lib-object-copy';
|
|
3
|
+
import { objectCopy } from 'sxy-lib-object-copy';
|
|
4
4
|
import { watchFilesAndRunTestsNodeWatch } from './watchFilesAndRunTestsNodeWatch.js';
|
|
5
5
|
import { applyConfigDefaults } from './applyConfigDefaults.js';
|
|
6
6
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Config } from '../../types.js';
|
|
2
|
+
import type { WatchEvent } from './watchFilesNodeWatch.js';
|
|
3
|
+
export declare function watchFilesChokidar(config: Config, onEvent: WatchEvent): Promise<import('chokidar').FSWatcher>;
|
|
4
|
+
//# sourceMappingURL=watchFilesChokidar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watchFilesChokidar.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/watchFilesChokidar.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAI1D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,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EAAE,QAAQ,EAAE,EAAE;YAClC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA;YAC1B,KAAK,CAAC,eAAe,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;YACvC,OAAO,CACH,QAAQ,EACR,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAC1C,CAAA;QACL,CAAC,CAAC,CAAA;QAEF,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACzB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;gBACrB,KAAK,CAAC,wBAAwB,CAAC,CAAA;gBAC/B,OAAO,CAAC,OAAO,CAAC,CAAA;YACpB,CAAC,CAAC,CAAA;QACN,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Config } from '../../types.js';
|
|
2
|
+
export interface NodeWatchWatcher {
|
|
3
|
+
on(event: 'ready', listener: () => void): void;
|
|
4
|
+
}
|
|
5
|
+
export type WatchEvent = (filename: string, event: string) => void;
|
|
6
|
+
export declare function watchFilesNodeWatch(config: Config, onEvent: WatchEvent): Promise<NodeWatchWatcher>;
|
|
7
|
+
//# sourceMappingURL=watchFilesNodeWatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watchFilesNodeWatch.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/watchFilesNodeWatch.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAI5C,MAAM,WAAW,gBAAgB;IAC7B,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAA;CACjD;AAWD,MAAM,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAA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AM,CAAC,KAAK,CAAC,cAAc,KAAK,EAAE,EAAE,CAAC;YACrC,GAAG,CAAC,8DAA8D,CAAC,CAAA;YACnE,MAAM,CAAC,KAAK,CAAC,cAAc,GAAG,GAAG,CAAA;QACrC,CAAC;QAED,MAAM,OAAO,GAAG,SAAS,CACrB,MAAM,CAAC,KAAK,CAAC,cAAc,EAC3B;YACI,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,WAAW;SACtB,EACD,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YAChB,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA;YAC1B,KAAK,CAAC,aAAa,CAAC,CAAA;YACpB,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;QAC5B,CAAC,CACJ,CAAA;QAED,kCAAkC;QAClC,MAAM,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;YAC9B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAChC,CAAC,CAAC,CAAA;QAEF,OAAO,OAAO,CAAA;IAClB,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"once.d.ts","sourceRoot":"","sources":["../../src/cli/once.ts"],"names":[],"mappings":"AAKA,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAyC1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"once.js","sourceRoot":"","sources":["../../src/cli/once.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,kBAAkB,CAAA;AAEpC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAEvC,MAAM,CAAC,KAAK,UAAU,IAAI;IACtB,GAAG,CAAC,KAAK,CAAC,UAAU,CAAA,IAAI,WAAW,MAAM,CAAC,CAAA;IAE1C,M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AM,CAAC,mBAAmB,CAAC,CAAA;IACtD,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,GAAG,CAAC,KAAK,CAAC,UAAU,CAAA,kBAAkB,CAAC,CAAA;QACvC,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,CAAA;QACzD,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAClC,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,SAAS,CAAA;IAC7C,GAAG,CAAC,KAAK,CAAC,IAAI,CAAA,KAAK,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;IAE/C,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AAC1B,CAAC"}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/*
|
|
2
|
-
import figures from 'figures'
|
|
3
|
-
|
|
4
|
-
import { once } from './once.js'
|
|
5
|
-
|
|
6
|
-
mochaDescribe('once command', function() {
|
|
7
|
-
|
|
8
|
-
mochaIt('should run tests and output results', async function() {
|
|
9
|
-
this.timeout(12000)
|
|
10
|
-
|
|
11
|
-
const originalConsoleLog = console.log
|
|
12
|
-
let consoleLogBuffer = ''
|
|
13
|
-
console.log = sync(function testLog(...texts) {
|
|
14
|
-
consoleLogBuffer += texts.join(' ') + '\n'
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
global.commandLineArguments = []
|
|
18
|
-
|
|
19
|
-
promise( once() )
|
|
20
|
-
await new Promise( (resolve, reject) => { setTimeout(resolve, 8000) } )
|
|
21
|
-
|
|
22
|
-
console.log = originalConsoleLog
|
|
23
|
-
|
|
24
|
-
console.log(consoleLogBuffer)
|
|
25
|
-
|
|
26
|
-
const testFileName = `trialTests/example.test.js`
|
|
27
|
-
const thing = 'The example'
|
|
28
|
-
const should = '1 should equal 1'
|
|
29
|
-
|
|
30
|
-
consoleLogBuffer.should.include( testFileName )
|
|
31
|
-
consoleLogBuffer.should.include( thing )
|
|
32
|
-
consoleLogBuffer.should.include( should )
|
|
33
|
-
consoleLogBuffer.should.include( figures.tick )
|
|
34
|
-
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
|
|
1
|
+
/*
|
|
2
|
+
import figures from 'figures'
|
|
3
|
+
|
|
4
|
+
import { once } from './once.js'
|
|
5
|
+
|
|
6
|
+
mochaDescribe('once command', function() {
|
|
7
|
+
|
|
8
|
+
mochaIt('should run tests and output results', async function() {
|
|
9
|
+
this.timeout(12000)
|
|
10
|
+
|
|
11
|
+
const originalConsoleLog = console.log
|
|
12
|
+
let consoleLogBuffer = ''
|
|
13
|
+
console.log = sync(function testLog(...texts) {
|
|
14
|
+
consoleLogBuffer += texts.join(' ') + '\n'
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
global.commandLineArguments = []
|
|
18
|
+
|
|
19
|
+
promise( once() )
|
|
20
|
+
await new Promise( (resolve, reject) => { setTimeout(resolve, 8000) } )
|
|
21
|
+
|
|
22
|
+
console.log = originalConsoleLog
|
|
23
|
+
|
|
24
|
+
console.log(consoleLogBuffer)
|
|
25
|
+
|
|
26
|
+
const testFileName = `trialTests/example.test.js`
|
|
27
|
+
const thing = 'The example'
|
|
28
|
+
const should = '1 should equal 1'
|
|
29
|
+
|
|
30
|
+
consoleLogBuffer.should.include( testFileName )
|
|
31
|
+
consoleLogBuffer.should.include( thing )
|
|
32
|
+
consoleLogBuffer.should.include( should )
|
|
33
|
+
consoleLogBuffer.should.include( figures.tick )
|
|
34
|
+
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
})
|
|
38
|
+
|
|
39
39
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/cli/watch.ts"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AE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAA;YACtD,GAAG,CAAC,KAAK,CAAC,UAAU,CAAA,0BAA0B,CAAC,CAAA;YAC/C,KAAK,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;gBACrD,GAAG,CAAC,KAAK,CAAC,UAAU,CAAA,aAAa,CAAC,CAAA;YACtC,CAAC,CAAC,CAAA;QACN,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,GAAG,CAAC,KAAK,CAAC,UAAU,CAAA,gBAAgB,CAAC,CAAA;QACrC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAA,aAAa,CAAC,CAAA;IACtC,CAAC;IAED,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,MAAM,CAAC,gCAAgC,CAAC,CAAA;IAChF,MAAM,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,CAAC,CAAA;IAE7E,MAAM,IAAI,OAAO,CAAO,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;IAEjC,8CAA8C;IAC9C,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAA;IAClE,cAAc,CAAC,MAAM,CAAC,CAAA;AAC1B,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const packageName = "sxy-test-runner";
|
|
2
|
+
export declare const cliName = "sxy-test";
|
|
3
|
+
export declare const configFileName = "sxy-test-runner.config";
|
|
4
|
+
export declare const configLocations: string[];
|
|
5
|
+
export declare const debugging = false;
|
|
6
|
+
export declare const showTimeProfiling = false;
|
|
7
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,oBAAoB,CAAA;AAE5C,eAAO,MAAM,OAAO,aAAa,CAAA;AAEjC,eAAO,MAAM,cAAc,2BAA2B,CAAA;AACtD,eAAO,MAAM,eAAe,UAAiB,CAAA;AAE7C,eAAO,MAAM,SAAS,QAAQ,CAAA;AAE9B,eAAO,MAAM,iBAAiB,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAA;AAE5C,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAA;AAEjC,MAAM,CAAC,MAAM,cAAc,GAAG,wBAAwB,CAAA;AACtD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA,CAAC,2DAA2D;AAEzG,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAA;AAE9B,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAA"}
|
package/dist/describe-old.js
CHANGED
|
@@ -85,187 +85,187 @@ export async function describe(theThing, tests) {
|
|
|
85
85
|
await debug(chalk.lightgrey`${thisDescribeCounter})` + chalk.lightgrey` Done with ` + chalk.brightblue`${theThing}\n`);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
/*
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
export async function describe(theThing, tests, testFilename) {
|
|
92
|
-
|
|
93
|
-
const timeProfiling = {}
|
|
94
|
-
timeProfiling.beforeDescribe = (new Date).getTime()
|
|
95
|
-
|
|
96
|
-
//log('tests state 1', testsState)
|
|
97
|
-
|
|
98
|
-
const thisDescribeCounter = testsState.describeCounter++ // ++: assign the value, THEN increment
|
|
99
|
-
|
|
100
|
-
//log('tests state 1.5', testsState)
|
|
101
|
-
|
|
102
|
-
let testCounter = 1
|
|
103
|
-
let testResults = []
|
|
104
|
-
|
|
105
|
-
const its = []
|
|
106
|
-
async function it(should, test) {
|
|
107
|
-
its.push([should, test])
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// async function it(should, test) {
|
|
112
|
-
|
|
113
|
-
// const timeProfiling = {}
|
|
114
|
-
// timeProfiling.beforeIt = (new Date).getTime()
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
// const thisTestCounter = testCounter++ // ++: assign the value, THEN increment
|
|
118
|
-
// let success = null
|
|
119
|
-
// let error
|
|
120
|
-
// try {
|
|
121
|
-
// await test()
|
|
122
|
-
// if (success === null) success = true
|
|
123
|
-
// } catch (e) {
|
|
124
|
-
// success = false
|
|
125
|
-
// //console.log(e)
|
|
126
|
-
// error = e
|
|
127
|
-
// }
|
|
128
|
-
|
|
129
|
-
// const testResult = {
|
|
130
|
-
// counter: thisTestCounter,
|
|
131
|
-
// should,
|
|
132
|
-
// success,
|
|
133
|
-
// error
|
|
134
|
-
// }
|
|
135
|
-
|
|
136
|
-
// testResults.push(testResult)
|
|
137
|
-
// testsState.testResults.push(testResult)
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
// timeProfiling.afterIt = (new Date).getTime()
|
|
141
|
-
// timeProfilingOut(`it ${should}`, timeProfiling.beforeIt, timeProfiling.afterIt)
|
|
142
|
-
|
|
143
|
-
// }
|
|
144
|
-
|
|
145
|
-
let beforeFunc
|
|
146
|
-
async function before(func) {
|
|
147
|
-
beforeFunc = func
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
let afterFunc
|
|
151
|
-
async function after(func) {
|
|
152
|
-
afterFunc = func
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
tests({it, before, after})
|
|
156
|
-
|
|
157
|
-
//log('tests state2', testsState)
|
|
158
|
-
|
|
159
|
-
testsState.theseDescribes.push({theThing, its, counter: thisDescribeCounter})
|
|
160
|
-
|
|
161
|
-
await run('do the tests', async () => {
|
|
162
|
-
for (const it of its) {
|
|
163
|
-
await testIt(...it)
|
|
164
|
-
}
|
|
165
|
-
})
|
|
166
|
-
|
|
167
|
-
async function testIt(should, test) {
|
|
168
|
-
|
|
169
|
-
await timeProfileAsync(`it ${should}`, async () => {
|
|
170
|
-
|
|
171
|
-
const timeStart = (new Date).getTime()
|
|
172
|
-
|
|
173
|
-
const thisTestCounter = testCounter++ // ++: assign the value, THEN increment
|
|
174
|
-
let success = null
|
|
175
|
-
let error
|
|
176
|
-
try {
|
|
177
|
-
await test()
|
|
178
|
-
if (success === null) success = true
|
|
179
|
-
} catch (e) {
|
|
180
|
-
success = false
|
|
181
|
-
error = e
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
const timeEnd = (new Date).getTime()
|
|
185
|
-
const time = timeEnd - timeStart
|
|
186
|
-
|
|
187
|
-
const testResult = {
|
|
188
|
-
counter: thisTestCounter,
|
|
189
|
-
should,
|
|
190
|
-
success,
|
|
191
|
-
time,
|
|
192
|
-
error
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
testResults.push(testResult)
|
|
196
|
-
testsState.testResults.push(testResult)
|
|
197
|
-
|
|
198
|
-
// out(`${time.localeString()}ms`)
|
|
199
|
-
})
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
//console.log('testResults A', testResults)
|
|
204
|
-
testResults = testResults.sort( (a, b) => a.counter - b.counter )
|
|
205
|
-
//console.log('testResults B', testResults)
|
|
206
|
-
|
|
207
|
-
out(
|
|
208
|
-
chalk.lightgrey`${thisDescribeCounter})`
|
|
209
|
-
+ chalk.lightgrey` Describing` + chalk.brightblue` ${theThing}\n`
|
|
210
|
-
)
|
|
211
|
-
|
|
212
|
-
let describeSuccess = null
|
|
213
|
-
const describeErrors = []
|
|
214
|
-
|
|
215
|
-
for (const testResult of testResults) {
|
|
216
|
-
const indexLetters = indexNumberToLetters(testResult.counter)
|
|
217
|
-
if (testResult.success) {
|
|
218
|
-
if (describeSuccess === null) describeSuccess = true
|
|
219
|
-
out(
|
|
220
|
-
chalk.lightgrey` ${indexLetters})`
|
|
221
|
-
+ chalk.mediumgreen(` ${figures.tick} ${testResult.should}`)
|
|
222
|
-
)
|
|
223
|
-
} else {
|
|
224
|
-
describeSuccess = false
|
|
225
|
-
describeErrors.push(testResult.error)
|
|
226
|
-
out(
|
|
227
|
-
chalk.lightgrey` ${indexLetters})`
|
|
228
|
-
+ chalk.mediumred` ${figures.cross} ${testResult.should}\n`
|
|
229
|
-
+ chalk.mediumred` ${testResult.error}`
|
|
230
|
-
)
|
|
231
|
-
// out(
|
|
232
|
-
// chalk.lightgrey` ${indexLetters})`
|
|
233
|
-
// + chalk.brightred` ${figures.cross} ${testResult.should}\n`
|
|
234
|
-
// + chalk.brightred` ${testResult.errors}`
|
|
235
|
-
// )
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const describeResult = {
|
|
240
|
-
counter: thisDescribeCounter,
|
|
241
|
-
theThing,
|
|
242
|
-
success: describeSuccess,
|
|
243
|
-
errors: describeErrors
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
testsState.describeResults.push(describeResult)
|
|
247
|
-
|
|
248
|
-
out(``)
|
|
249
|
-
|
|
250
|
-
timeProfiling.afterDescribe = (new Date).getTime()
|
|
251
|
-
timeProfilingOut(`describe ${theThing}`, timeProfiling.beforeDescribe, timeProfiling.afterDescribe)
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
global.endTest[testFilename] = (new Date).getTime()
|
|
255
|
-
timeProfilingOutSpecial(`full test ${testFilename}`, global.startTest[testFilename], global.endTest[testFilename])
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
// export async function it(should, test) {
|
|
260
|
-
// out(chalk`theThing`)
|
|
261
|
-
// await test()
|
|
262
|
-
// }
|
|
263
|
-
|
|
264
|
-
//export const test = it
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
function run(name, func) {
|
|
268
|
-
return func()
|
|
269
|
-
}
|
|
270
|
-
|
|
88
|
+
/*
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
export async function describe(theThing, tests, testFilename) {
|
|
92
|
+
|
|
93
|
+
const timeProfiling = {}
|
|
94
|
+
timeProfiling.beforeDescribe = (new Date).getTime()
|
|
95
|
+
|
|
96
|
+
//log('tests state 1', testsState)
|
|
97
|
+
|
|
98
|
+
const thisDescribeCounter = testsState.describeCounter++ // ++: assign the value, THEN increment
|
|
99
|
+
|
|
100
|
+
//log('tests state 1.5', testsState)
|
|
101
|
+
|
|
102
|
+
let testCounter = 1
|
|
103
|
+
let testResults = []
|
|
104
|
+
|
|
105
|
+
const its = []
|
|
106
|
+
async function it(should, test) {
|
|
107
|
+
its.push([should, test])
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
// async function it(should, test) {
|
|
112
|
+
|
|
113
|
+
// const timeProfiling = {}
|
|
114
|
+
// timeProfiling.beforeIt = (new Date).getTime()
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
// const thisTestCounter = testCounter++ // ++: assign the value, THEN increment
|
|
118
|
+
// let success = null
|
|
119
|
+
// let error
|
|
120
|
+
// try {
|
|
121
|
+
// await test()
|
|
122
|
+
// if (success === null) success = true
|
|
123
|
+
// } catch (e) {
|
|
124
|
+
// success = false
|
|
125
|
+
// //console.log(e)
|
|
126
|
+
// error = e
|
|
127
|
+
// }
|
|
128
|
+
|
|
129
|
+
// const testResult = {
|
|
130
|
+
// counter: thisTestCounter,
|
|
131
|
+
// should,
|
|
132
|
+
// success,
|
|
133
|
+
// error
|
|
134
|
+
// }
|
|
135
|
+
|
|
136
|
+
// testResults.push(testResult)
|
|
137
|
+
// testsState.testResults.push(testResult)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
// timeProfiling.afterIt = (new Date).getTime()
|
|
141
|
+
// timeProfilingOut(`it ${should}`, timeProfiling.beforeIt, timeProfiling.afterIt)
|
|
142
|
+
|
|
143
|
+
// }
|
|
144
|
+
|
|
145
|
+
let beforeFunc
|
|
146
|
+
async function before(func) {
|
|
147
|
+
beforeFunc = func
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
let afterFunc
|
|
151
|
+
async function after(func) {
|
|
152
|
+
afterFunc = func
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
tests({it, before, after})
|
|
156
|
+
|
|
157
|
+
//log('tests state2', testsState)
|
|
158
|
+
|
|
159
|
+
testsState.theseDescribes.push({theThing, its, counter: thisDescribeCounter})
|
|
160
|
+
|
|
161
|
+
await run('do the tests', async () => {
|
|
162
|
+
for (const it of its) {
|
|
163
|
+
await testIt(...it)
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
async function testIt(should, test) {
|
|
168
|
+
|
|
169
|
+
await timeProfileAsync(`it ${should}`, async () => {
|
|
170
|
+
|
|
171
|
+
const timeStart = (new Date).getTime()
|
|
172
|
+
|
|
173
|
+
const thisTestCounter = testCounter++ // ++: assign the value, THEN increment
|
|
174
|
+
let success = null
|
|
175
|
+
let error
|
|
176
|
+
try {
|
|
177
|
+
await test()
|
|
178
|
+
if (success === null) success = true
|
|
179
|
+
} catch (e) {
|
|
180
|
+
success = false
|
|
181
|
+
error = e
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const timeEnd = (new Date).getTime()
|
|
185
|
+
const time = timeEnd - timeStart
|
|
186
|
+
|
|
187
|
+
const testResult = {
|
|
188
|
+
counter: thisTestCounter,
|
|
189
|
+
should,
|
|
190
|
+
success,
|
|
191
|
+
time,
|
|
192
|
+
error
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
testResults.push(testResult)
|
|
196
|
+
testsState.testResults.push(testResult)
|
|
197
|
+
|
|
198
|
+
// out(`${time.localeString()}ms`)
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
//console.log('testResults A', testResults)
|
|
204
|
+
testResults = testResults.sort( (a, b) => a.counter - b.counter )
|
|
205
|
+
//console.log('testResults B', testResults)
|
|
206
|
+
|
|
207
|
+
out(
|
|
208
|
+
chalk.lightgrey`${thisDescribeCounter})`
|
|
209
|
+
+ chalk.lightgrey` Describing` + chalk.brightblue` ${theThing}\n`
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
let describeSuccess = null
|
|
213
|
+
const describeErrors = []
|
|
214
|
+
|
|
215
|
+
for (const testResult of testResults) {
|
|
216
|
+
const indexLetters = indexNumberToLetters(testResult.counter)
|
|
217
|
+
if (testResult.success) {
|
|
218
|
+
if (describeSuccess === null) describeSuccess = true
|
|
219
|
+
out(
|
|
220
|
+
chalk.lightgrey` ${indexLetters})`
|
|
221
|
+
+ chalk.mediumgreen(` ${figures.tick} ${testResult.should}`)
|
|
222
|
+
)
|
|
223
|
+
} else {
|
|
224
|
+
describeSuccess = false
|
|
225
|
+
describeErrors.push(testResult.error)
|
|
226
|
+
out(
|
|
227
|
+
chalk.lightgrey` ${indexLetters})`
|
|
228
|
+
+ chalk.mediumred` ${figures.cross} ${testResult.should}\n`
|
|
229
|
+
+ chalk.mediumred` ${testResult.error}`
|
|
230
|
+
)
|
|
231
|
+
// out(
|
|
232
|
+
// chalk.lightgrey` ${indexLetters})`
|
|
233
|
+
// + chalk.brightred` ${figures.cross} ${testResult.should}\n`
|
|
234
|
+
// + chalk.brightred` ${testResult.errors}`
|
|
235
|
+
// )
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const describeResult = {
|
|
240
|
+
counter: thisDescribeCounter,
|
|
241
|
+
theThing,
|
|
242
|
+
success: describeSuccess,
|
|
243
|
+
errors: describeErrors
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
testsState.describeResults.push(describeResult)
|
|
247
|
+
|
|
248
|
+
out(``)
|
|
249
|
+
|
|
250
|
+
timeProfiling.afterDescribe = (new Date).getTime()
|
|
251
|
+
timeProfilingOut(`describe ${theThing}`, timeProfiling.beforeDescribe, timeProfiling.afterDescribe)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
global.endTest[testFilename] = (new Date).getTime()
|
|
255
|
+
timeProfilingOutSpecial(`full test ${testFilename}`, global.startTest[testFilename], global.endTest[testFilename])
|
|
256
|
+
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// export async function it(should, test) {
|
|
260
|
+
// out(chalk`theThing`)
|
|
261
|
+
// await test()
|
|
262
|
+
// }
|
|
263
|
+
|
|
264
|
+
//export const test = it
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
function run(name, func) {
|
|
268
|
+
return func()
|
|
269
|
+
}
|
|
270
|
+
|
|
271
271
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../src/describe.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAuBxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../src/describe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,kBAAkB,CAAA;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAGnC,MAAM,UAAU,QAAQ,CAAC,QAAgB,EAAE,KAAuB;IAC9D,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACX,oFAAoF;cAClF,0DAA0D;cAC1D,+CAA+C,CACpD,CAAA;QACD,gFAAgF;IACpF,CAAC;IAED,MAAM,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAA;IACtE,MAAM,CAAC,mBAAmB,CAAC,eAAe,EAAE,CAAA;IAE5C,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,CAAC;QACtC,OAAO,EAAE,mBAAmB;QAC5B,KAAK,EAAE,QAAQ;QACf,KAAK;KACR,CAAC,CAAA;IAEF,KAAK,CACD,KAAK,CAAC,SAAS,CAAA,GAAG,mBAAmB,GAAG;UAClC,KAAK,CAAC,SAAS,CAAA,aAAa,GAAG,KAAK,CAAC,UAAU,CAAA,GAAG,QAAQ,IAAI,CACvE,CAAA;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
test: (should: string, test: () => void) => void
|
|
4
|
-
afterDescribe: () => void
|
|
5
|
-
beforeEachTest: () => Record<string, any>
|
|
6
|
-
afterEachTest: () => Record<string, any>
|
|
7
|
-
}) => void | Promise<void>): void
|
|
1
|
+
export { describe } from './describe.js';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexNumberToLetters.d.ts","sourceRoot":"","sources":["../src/indexNumberToLetters.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,MAAM,GAAG,SAAS,CAW1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexNumberToLetters.js","sourceRoot":"","sources":["../src/indexNumberToLetters.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,SAAS,GAAG,KAAK;IAClE,MAAM,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACzC,IAAI,IAAI,GAAG,EAAE,CAAA;IACb,IAAI,WAAmB,CAAA;IAEvB,OAAO,MAAM,GAAG,CAAC,EAAE,CAAC;QAChB,WAAW,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;QAC/B,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,aAAa,GAAG,WAAW,CAAC,GAAG,IAAI,CAAA;QAC9D,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;IAC9C,CAAC;IACD,OAAO,IAAI,IAAI,SAAS,CAAA;AAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrayRemove.d.ts","sourceRoot":"","sources":["../../src/lib/arrayRemove.ts"],"names":[],"mappings":"AACA,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,GAAG,YAAY,EAAE,CAAC,EAAE,GAAG,IAAI,CAYrE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Replaces the sxy-standard Array.prototype.remove() patch this codebase relied on.
|
|
2
|
+
export function arrayRemove(array, ...removeValues) {
|
|
3
|
+
for (const removeValue of removeValues) {
|
|
4
|
+
let i = 0;
|
|
5
|
+
let length = array.length;
|
|
6
|
+
for (; i < length; i++) {
|
|
7
|
+
if (array[i] === removeValue) {
|
|
8
|
+
array.splice(i, 1);
|
|
9
|
+
i--;
|
|
10
|
+
length--;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=arrayRemove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrayRemove.js","sourceRoot":"","sources":["../../src/lib/arrayRemove.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,UAAU,WAAW,CAAI,KAAU,EAAE,GAAG,YAAiB;IAC3D,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACrC,IAAI,CAAC,GAAG,CAAC,CAAA;QACT,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,CAAA;QACzB,OAAO,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrB,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,WAAW,EAAE,CAAC;gBAC3B,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAClB,CAAC,EAAE,CAAA;gBACH,MAAM,EAAE,CAAA;YACZ,CAAC;QACL,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promiseAllObj.d.ts","sourceRoot":"","sources":["../../src/lib/promiseAllObj.ts"],"names":[],"mappings":"AACA,wBAAsB,aAAa,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAU1G"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Replaces the sxy-standard Promise.allObj() patch this codebase relied on.
|
|
2
|
+
export async function promiseAllObj(promisesMap) {
|
|
3
|
+
const results = {};
|
|
4
|
+
const promisesArr = [];
|
|
5
|
+
for (const key in promisesMap) {
|
|
6
|
+
const promise = promisesMap[key];
|
|
7
|
+
if (promise === undefined)
|
|
8
|
+
continue;
|
|
9
|
+
promisesArr.push(promise.then(result => { results[key] = result; }));
|
|
10
|
+
}
|
|
11
|
+
await Promise.all(promisesArr);
|
|
12
|
+
return results;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=promiseAllObj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promiseAllObj.js","sourceRoot":"","sources":["../../src/lib/promiseAllObj.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,WAAuC;IAC1E,MAAM,OAAO,GAAsB,EAAE,CAAA;IACrC,MAAM,WAAW,GAA4B,EAAE,CAAA;IAC/C,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAA;QAChC,IAAI,OAAO,KAAK,SAAS;YAAE,SAAQ;QACnC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAA,CAAC,CAAC,CAAC,CAAC,CAAA;IACvE,CAAC;IACD,MAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IAC9B,OAAO,OAAO,CAAA;AAClB,CAAC"}
|