sxy-test-runner 1.0.3 → 1.0.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.
Files changed (95) hide show
  1. package/package.json +1 -1
  2. package/dist/cli/init.js +0 -170
  3. package/dist/cli/init.unitTest.js +0 -0
  4. package/dist/cli/lib/addBasePath.js +0 -15
  5. package/dist/cli/lib/addBasePath.unitTest.js +0 -31
  6. package/dist/cli/lib/addExports.js +0 -12
  7. package/dist/cli/lib/addExports.unitTest.js +0 -29
  8. package/dist/cli/lib/applyConfigDefaults.js +0 -41
  9. package/dist/cli/lib/applyConfigDefaults.unitTest.js +0 -25
  10. package/dist/cli/lib/buildDependencyTree.js +0 -32
  11. package/dist/cli/lib/buildDependencyTree.unitTest.js +0 -15
  12. package/dist/cli/lib/buildDependencyTrees.js +0 -34
  13. package/dist/cli/lib/buildDependencyTrees.unitTest.js +0 -17
  14. package/dist/cli/lib/configBeforeAfterFuncs.js +0 -35
  15. package/dist/cli/lib/configBeforeAfterFuncs.unitTest.js +0 -0
  16. package/dist/cli/lib/defaultConfig.js +0 -22
  17. package/dist/cli/lib/defaultConfig.test.js +0 -7
  18. package/dist/cli/lib/doUserSetup.js +0 -30
  19. package/dist/cli/lib/doUserSetup.unitTest.js +0 -39
  20. package/dist/cli/lib/doUserTeardown.js +0 -30
  21. package/dist/cli/lib/doUserTeardown.unitTest.js +0 -39
  22. package/dist/cli/lib/findTestFiles.js +0 -24
  23. package/dist/cli/lib/findTestFiles.unitTest.js +0 -22
  24. package/dist/cli/lib/getAllowedFlags.js +0 -11
  25. package/dist/cli/lib/getAllowedFlags.unitTest.js +0 -20
  26. package/dist/cli/lib/globArgCombine.js +0 -1
  27. package/dist/cli/lib/globArgCombine.unitTest.js +0 -18
  28. package/dist/cli/lib/injectProperties.js +0 -11
  29. package/dist/cli/lib/injectProperties.unitTest.js +0 -75
  30. package/dist/cli/lib/load.js +0 -3
  31. package/dist/cli/lib/load.unitTest.js +0 -7
  32. package/dist/cli/lib/loadConfig.js +0 -21
  33. package/dist/cli/lib/loadConfig.unitTest.js +0 -15
  34. package/dist/cli/lib/loadTestFile.js +0 -75
  35. package/dist/cli/lib/loadTestFile.unitTest.js +0 -51
  36. package/dist/cli/lib/loadTestFileStatic.js +0 -40
  37. package/dist/cli/lib/loadTestFileStatic.unitTest.js +0 -29
  38. package/dist/cli/lib/overrideConsoleLog.js +0 -20
  39. package/dist/cli/lib/overrideConsoleLog.unitTest.js +0 -0
  40. package/dist/cli/lib/parseCommandLineArguments.js +0 -57
  41. package/dist/cli/lib/parseCommandLineArguments.unitTest.js +0 -21
  42. package/dist/cli/lib/processWatchEvent.js +0 -0
  43. package/dist/cli/lib/processWatchEvent.unitTest.js +0 -7
  44. package/dist/cli/lib/reservedExportKeys.js +0 -1
  45. package/dist/cli/lib/reservedExportKeys.unitTest.js +0 -7
  46. package/dist/cli/lib/runDescribe.js +0 -141
  47. package/dist/cli/lib/runDescribe.unitTest.js +0 -7
  48. package/dist/cli/lib/runIt.js +0 -70
  49. package/dist/cli/lib/runIt.unitTest.js +0 -7
  50. package/dist/cli/lib/runTasks.js +0 -42
  51. package/dist/cli/lib/runTasks.unitTest.js +0 -30
  52. package/dist/cli/lib/runTest-old.js +0 -159
  53. package/dist/cli/lib/runTest-old.unitTest.js +0 -183
  54. package/dist/cli/lib/runTestFile copy.js +0 -292
  55. package/dist/cli/lib/runTestFile-old.js +0 -348
  56. package/dist/cli/lib/runTestFile.js +0 -105
  57. package/dist/cli/lib/runTestFile.unitTest.js +0 -264
  58. package/dist/cli/lib/runTestFiles.js +0 -141
  59. package/dist/cli/lib/runTestFiles.unitTest.js +0 -147
  60. package/dist/cli/lib/shouldCaptureConsoleLog.js +0 -24
  61. package/dist/cli/lib/shouldCaptureConsoleLog.unitTest.js +0 -31
  62. package/dist/cli/lib/showTestLoadingError.js +0 -22
  63. package/dist/cli/lib/showTestLoadingError.unitTest.js +0 -25
  64. package/dist/cli/lib/showTestResult.js +0 -87
  65. package/dist/cli/lib/showTestResult.unitTest.js +0 -180
  66. package/dist/cli/lib/validateConfig.js +0 -29
  67. package/dist/cli/lib/validateConfig.unitTest.js +0 -22
  68. package/dist/cli/lib/watchFiles.js +0 -1
  69. package/dist/cli/lib/watchFiles.unitTest.js +0 -48
  70. package/dist/cli/lib/watchFilesAndRunTests.js +0 -2
  71. package/dist/cli/lib/watchFilesAndRunTests.unitTest.js +0 -129
  72. package/dist/cli/lib/watchFilesAndRunTestsChokidar.js +0 -142
  73. package/dist/cli/lib/watchFilesAndRunTestsChokidar.unitTest.js +0 -133
  74. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js +0 -162
  75. package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.unitTest.js +0 -131
  76. package/dist/cli/lib/watchFilesChokidar.js +0 -56
  77. package/dist/cli/lib/watchFilesChokidar.unitTest.js +0 -85
  78. package/dist/cli/lib/watchFilesNodeWatch.js +0 -42
  79. package/dist/cli/lib/watchFilesNodeWatch.unitTest.js +0 -48
  80. package/dist/cli/once.js +0 -47
  81. package/dist/cli/once.unitTest.js +0 -39
  82. package/dist/cli/watch.js +0 -100
  83. package/dist/cli/watch.unitTest.js +0 -117
  84. package/dist/config.js +0 -7
  85. package/dist/describe-old.js +0 -257
  86. package/dist/describe-old.unitTest.js +0 -21
  87. package/dist/describe.js +0 -24
  88. package/dist/describe.unitTest.js +0 -27
  89. package/dist/exported.eslintrc.cjs +0 -7
  90. package/dist/index.js +0 -1
  91. package/dist/indexNumberToLetters.js +0 -13
  92. package/dist/load.js +0 -3
  93. package/dist/output.js +0 -17
  94. package/dist/testsState.js +0 -4
  95. package/dist/timeProfiling.js +0 -9
@@ -1,85 +0,0 @@
1
- import { promises as fs } from 'fs';
2
- import { watchFilesChokidar } from './watchFilesChokidar.js';
3
- import { applyConfigDefaults } from './applyConfigDefaults.js'; // watchFiles(config, testFiles, dependencyTrees, failingTests) ???
4
-
5
- await mochaDescribe('watchFilesChokidar() function', async function () {
6
- await mochaIt('should call back when when a file change occurs', async function () {
7
- await this.timeout(12000);
8
- const config = await applyConfigDefaults({});
9
- let eventComplete = false;
10
- await watchFilesChokidar(config, async (filename, event) => {
11
- eventComplete = true;
12
- });
13
- await fs.writeFile('temp/watchFilesChokidar-file.js', 'abc');
14
- await new Promise(async (resolve, reject) => {
15
- const interval = await setInterval(async () => {
16
- if (eventComplete) {
17
- await clearInterval(interval);
18
- await resolve();
19
- }
20
- }, 50);
21
- });
22
- await eventComplete.should.equal(true);
23
- });
24
- await mochaIt('should call back when when a file change occurs in specified folder', async function () {
25
- await this.timeout(12000);
26
- const config = await applyConfigDefaults({
27
- watch: {
28
- watchFilesBase: 'temp/watchFilesChokidar',
29
- watchFiles: '**/*.js'
30
- }
31
- });
32
- let eventComplete = false;
33
- await watchFilesChokidar(config, async (filename, event) => {
34
- eventComplete = true;
35
- });
36
- await fs.writeFile('temp/watchFilesChokidar/a-file.js', 'abc');
37
- await new Promise(async (resolve, reject) => {
38
- const interval = await setInterval(async () => {
39
- if (eventComplete) {
40
- await clearInterval(interval);
41
- await resolve();
42
- }
43
- }, 50);
44
- });
45
- await eventComplete.should.equal(true);
46
- });
47
- await mochaIt('ignores a file based on ignore glob', async function () {
48
- await this.timeout(12000);
49
- const config = await applyConfigDefaults({
50
- watch: {
51
- watchFilesBase: 'temp/watchFilesChokidar',
52
- watchFiles: '**/*.js',
53
- watchFilesIgnore: 'ignore-file.js'
54
- }
55
- });
56
- let eventComplete = false;
57
- await watchFilesChokidar(config, async (filename, event) => {
58
- eventComplete = true;
59
- });
60
- await fs.writeFile('temp/watchFilesChokidar/ignore-file.js', 'abc');
61
- await new Promise(async (resolve, reject) => {
62
- await setTimeout(resolve, 1000);
63
- });
64
- await eventComplete.should.not.equal(true);
65
- });
66
- await mochaIt('ignores a file based on ignore globs array', async function () {
67
- //this.timeout(100000)
68
- const config = await applyConfigDefaults({
69
- watch: {
70
- watchFilesBase: 'temp/watchFilesChokidar',
71
- watchFiles: '**/*.js',
72
- watchFilesIgnore: ['first-ignore-file.js', 'ignore-file.js']
73
- }
74
- });
75
- let eventComplete = false;
76
- await watchFilesChokidar(config, async (filename, event) => {
77
- eventComplete = true;
78
- });
79
- await fs.writeFile('temp/watchFilesChokidar/ignore-file.js', 'abc');
80
- await new Promise(async (resolve, reject) => {
81
- await setTimeout(resolve, 1000);
82
- });
83
- await eventComplete.should.not.equal(true);
84
- });
85
- });
@@ -1,42 +0,0 @@
1
- import { createTimeProfiler } from 'sxy-dev-tools';
2
- import { showTimeProfiling } from '../../config.js';
3
- import chalk from 'chalk-extensions';
4
- import minimatch from 'minimatch';
5
- import slash from 'slash';
6
- import watch from 'node-watch'; //import chokidar from 'chokidar'
7
- //import nsfw from 'nsfw'
8
-
9
- import fs from 'fs';
10
- import { out, log, debug } from '../../output.js';
11
- import { globArgCombine } from './globArgCombine.js';
12
- const {
13
- timeProfileAsync
14
- } = await createTimeProfiler(showTimeProfiling);
15
- export async function watchFilesNodeWatch(config, onEvent) {
16
- await timeProfileAsync('start watching', async () => {
17
- //const testGlobs = addBaseToGlobs(config.testsBase, config.tests)
18
- //const ignoreGlobs = addBaseToGlobs(config.testsBase, config.testsIgnore)
19
- // indentify a test file
20
- // identify a file we should be watching and responding to
21
- const watchFilter = file => (!config.watch.watchFiles || minimatch(file, globArgCombine(config.watch.watchFiles))) && (!config.watch.watchFilesIgnore || !minimatch(file, globArgCombine(config.watch.watchFilesIgnore)));
22
-
23
- if (!config.watch.watchFilesBase) {
24
- await out(`No config.watch.watchFilesBase provided, defaulting to '.'`);
25
- config.watch.watchFilesBase = '.';
26
- }
27
-
28
- const watcher = await watch(config.watch.watchFilesBase, {
29
- recursive: true,
30
- filter: watchFilter
31
- }, async function (event, filename) {
32
- filename = await slash(filename);
33
- await debug('watch event');
34
- await onEvent(filename, event);
35
- }); // wait until the watcher is ready
36
-
37
- await new Promise(async (resolve, reject) => {
38
- await watcher.on('ready', resolve);
39
- });
40
- return watcher;
41
- }); //return new Promise( () => {} ) // infinite promise to let us watch
42
- }
@@ -1,48 +0,0 @@
1
- import { promises as fs } from 'fs';
2
- import { watchFilesNodeWatch } from './watchFilesNodeWatch.js';
3
- import { applyConfigDefaults } from './applyConfigDefaults.js'; // watchFiles(config, callback)
4
-
5
- await mochaDescribe('watchFilesNodeWatch() function', async function () {
6
- await mochaIt('should call back when when a file change occurs', async function () {
7
- //this.timeout(100000)
8
- const config = await applyConfigDefaults({});
9
- let eventComplete = false;
10
- await watchFilesNodeWatch(config, async (filename, event) => {
11
- eventComplete = true;
12
- });
13
- await fs.writeFile('temp/watchFiles-file.js', 'abc');
14
- await new Promise(async (resolve, reject) => {
15
- const interval = await setInterval(async () => {
16
- if (eventComplete) {
17
- await clearInterval(interval);
18
- await resolve();
19
- }
20
- }, 50);
21
- });
22
- await eventComplete.should.equal(true);
23
- });
24
- await mochaIt('should call back when when a file change occurs in specified folder', async function () {
25
- //this.timeout(100000)
26
- const tempFolder = 'temp/watchFilesNodeWatcher';
27
- const config = await applyConfigDefaults({
28
- watch: {
29
- watchFilesBase: tempFolder,
30
- watchFiles: '**/*.js'
31
- }
32
- });
33
- let eventComplete = false;
34
- await watchFilesNodeWatch(config, async (filename, event) => {
35
- eventComplete = true;
36
- });
37
- await fs.writeFile(`${tempFolder}/a-file.js`, 'abc');
38
- await new Promise(async (resolve, reject) => {
39
- const interval = await setInterval(async () => {
40
- if (eventComplete) {
41
- await clearInterval(interval);
42
- await resolve();
43
- }
44
- }, 50);
45
- });
46
- await eventComplete.should.equal(true);
47
- });
48
- });
package/dist/cli/once.js DELETED
@@ -1,47 +0,0 @@
1
- import { createTimeProfiler } from 'sxy-dev-tools';
2
- import chalk from 'chalk-extensions';
3
- import { packageName, configFileName, configLocations, showTimeProfiling } from '../config.js';
4
- import { out, log, debug } from '../output.js';
5
- const {
6
- timeProfileAsync
7
- } = await createTimeProfiler(showTimeProfiling);
8
- export async function once() {
9
- await out(chalk.brightblue`[${packageName}]...`);
10
- const startTime = await new Date().getTime();
11
- const {
12
- loadConfig
13
- } = await import('./lib/loadConfig.js'); //// async function
14
-
15
- const userConfig = await loadConfig();
16
- const {
17
- applyConfigDefaults
18
- } = await import('./lib/applyConfigDefaults.js'); //// sync function
19
-
20
- const config = await applyConfigDefaults(userConfig);
21
- await log(chalk.brightblue`finding tests...`);
22
- const {
23
- findTestFiles
24
- } = await import('./lib/findTestFiles.js'); //// async function
25
-
26
- const testFiles = await findTestFiles(config);
27
-
28
- if (testFiles.length === 0) {
29
- await out(await chalk.orange(`[${packageName}] Found no tests.` + `\nTests patterns [${await config.tests.join(', ')}].` + `\nCreate tests matching the patterns, ` + `\nor set new patterns in ${configFileName}.* { tests: }`));
30
- const endTime = await new Date().getTime();
31
- const time = endTime - startTime;
32
- await out(await chalk.brightblue(`[${packageName}] time: ${await time.toLocaleString()}ms`));
33
- await process.exit(0);
34
- }
35
-
36
- const {
37
- runTestFiles
38
- } = await import('./lib/runTestFiles.js');
39
-
40
- if (testFiles.length > 0) {
41
- await log(chalk.brightblue`running tests...`);
42
- await runTestFiles(config, testFiles, []); //// async function, run in thread
43
- }
44
-
45
- const time = (await new Date().getTime()) - startTime;
46
- await out(chalk.grey`\n${await time.toLocaleString()}ms\n`);
47
- }
@@ -1,39 +0,0 @@
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
- */
package/dist/cli/watch.js DELETED
@@ -1,100 +0,0 @@
1
- import { createTimeProfiler } from 'sxy-dev-tools';
2
- import chalk from 'chalk-extensions';
3
- import { packageName, showTimeProfiling } from '../config.js';
4
- import { out, log, debug } from '../output.js';
5
- const {
6
- timeProfileAsync
7
- } = await createTimeProfiler(showTimeProfiling);
8
- export async function watch() {
9
- await out(chalk.brightblue`[${packageName}]...`);
10
- const {
11
- parseCommandLineArguments
12
- } = await import('./lib/parseCommandLineArguments.js'); //// async function
13
-
14
- const allowedClArguments = {
15
- 'config': {
16
- flag: 'c',
17
- hasValue: true
18
- }
19
- };
20
- const clArguments = await parseCommandLineArguments(allowedClArguments);
21
- await debug('clArguments', clArguments);
22
- const {
23
- loadConfig
24
- } = await import('./lib/loadConfig.js'); //// async function
25
-
26
- const userConfig = 'config' in clArguments ? await loadConfig(clArguments.config) : await loadConfig();
27
- const {
28
- applyConfigDefaults
29
- } = await import('./lib/applyConfigDefaults.js'); //// sync function
30
-
31
- const config = await applyConfigDefaults(userConfig);
32
- const {
33
- validateConfig
34
- } = await import('./lib/validateConfig.js'); //// sync function
35
-
36
- await validateConfig(config);
37
- const {
38
- doUserSetup
39
- } = await import('./lib/doUserSetup.js');
40
- await doUserSetup(config);
41
- await out(chalk.brightblue`finding tests...`);
42
- const {
43
- findTestFiles
44
- } = await import('./lib/findTestFiles.js'); //// async function
45
-
46
- const testFiles = await findTestFiles(config);
47
- await debug(testFiles); // global store of the dependencies of tests
48
-
49
- let dependencyTrees = {}; // store failing tests so we can re-run them.
50
-
51
- const failingTests = [];
52
-
53
- if (testFiles.length > 0) {
54
- const {
55
- buildDependencyTrees
56
- } = await import('./lib/buildDependencyTrees.js');
57
- await out(chalk.brightblue`finding initial dependency trees...`);
58
- dependencyTrees = await buildDependencyTrees(config, testFiles); //// sync function
59
-
60
- if (config.watch.runAllOnStartup) {
61
- const {
62
- runTests
63
- } = await import('./lib/runTests.js');
64
- await out(chalk.brightblue`running initial tests...`);
65
- runTests(config, testFiles, failingTests).then(async () => {
66
- await out(chalk.brightblue`watching...`);
67
- }); //// async function, run in separate thread
68
- }
69
- } else {
70
- await out(chalk.brightblue`no tests founds`);
71
- }
72
-
73
- const {
74
- watchFilesAndRunTests
75
- } = await import('./lib/watchFilesAndRunTests.js');
76
- await watchFilesAndRunTests(config, testFiles, dependencyTrees, failingTests); //// async function run in thread
77
-
78
- await new Promise(async () => {}); // won't run because promise will never finish
79
-
80
- const {
81
- doUserTeardown
82
- } = await import('./lib/doUserTeardown.js');
83
- await doUserTeardown(config); /////// SET UP?
84
- // if ( typeof config.setup === 'function' ) {
85
- // await timeProfile('run setup function', config.setup(/* can we pass anything here? */))
86
- // }
87
- } // runInitialTests
88
- //--find tests
89
- //if found tests,
90
- // find dependencyTrees
91
- // also, run tests
92
- //else
93
- // warn
94
- // dn't run initial tests
95
- // do we need to find initial test? yes
96
- // find tests
97
- // if found tests
98
- // make dep trees
99
- // else
100
- // warn
@@ -1,117 +0,0 @@
1
- import figures from 'figures';
2
- import { applyConfigDefaults } from './lib/applyConfigDefaults.js';
3
- import { watch } from './watch.js';
4
- await mochaDescribe('watch command', async function () {
5
- await mochaIt('should run tests and output results and display correct tallies', async function () {
6
- await this.timeout(10000);
7
- const originalConsoleLog = console.log;
8
- let consoleLogBuffer = '';
9
-
10
- console.log = function testLog(...texts) {
11
- consoleLogBuffer += texts.join(' ') + '\n';
12
- };
13
-
14
- global.commandLineArguments = ['--config', 'unitTesting/watch/sxy-test-runner.config.js'];
15
- watch();
16
- await new Promise(async (resolve, reject) => {
17
- await setTimeout(resolve, 8000);
18
- });
19
- console.log = originalConsoleLog; //console.log(consoleLogBuffer)
20
-
21
- const testFileName = `unitTesting/watch/1.test.js`;
22
- const thing = 'Sample test 1';
23
- const should = '1 should equal 1';
24
- await consoleLogBuffer.should.include(testFileName);
25
- await consoleLogBuffer.should.include(thing);
26
- await consoleLogBuffer.should.include(should);
27
- await consoleLogBuffer.should.include(figures.tick);
28
- await consoleLogBuffer.should.include('Tests: 3/3');
29
- await consoleLogBuffer.should.include('Items: 2/2');
30
- await consoleLogBuffer.should.include('Test Files: 2/2');
31
- });
32
- await mochaIt('should run tests and display correct tallies', async function () {
33
- await this.timeout(10000);
34
- const originalConsoleLog = console.log;
35
- let consoleLogBuffer = '';
36
-
37
- console.log = function testLog(...texts) {
38
- consoleLogBuffer += texts.join(' ') + '\n';
39
- };
40
-
41
- global.commandLineArguments = ['--config', 'unitTesting/watch/sxy-test-runner.config.js'];
42
- watch();
43
- await new Promise(async (resolve, reject) => {
44
- await setTimeout(resolve, 8000);
45
- });
46
- console.log = originalConsoleLog; //console.log(consoleLogBuffer)
47
-
48
- const testFileName = `unitTesting/watch/1.test.js`;
49
- const thing = 'Sample test 1';
50
- const should = '1 should equal 1';
51
- await consoleLogBuffer.should.include(testFileName);
52
- await consoleLogBuffer.should.include(thing);
53
- await consoleLogBuffer.should.include(should);
54
- await consoleLogBuffer.should.include(figures.tick);
55
- });
56
- await mochaIt('should warn us when there are no tests', async function () {
57
- await this.timeout(6000);
58
- const originalConsoleLog = console.log;
59
- let consoleLogBuffer = '';
60
-
61
- console.log = function testLog(...texts) {
62
- consoleLogBuffer += texts.join(' ') + '\n';
63
- };
64
-
65
- global.commandLineArguments = ['--config', 'sxy-test-runner.no-tests.config.js'];
66
- watch();
67
- await new Promise(async (resolve, reject) => {
68
- await setTimeout(resolve, 4000);
69
- });
70
- console.log = originalConsoleLog; //console.log('saved console.log output:')
71
- //console.log(consoleLogBuffer)
72
-
73
- await consoleLogBuffer.should.include('no tests found');
74
- await consoleLogBuffer.should.not.include('describing');
75
- });
76
- await mochaIt('should not run tests when asked not to run initial tests', async function () {
77
- await this.timeout(6000);
78
- const originalConsoleLog = console.log;
79
- let consoleLogBuffer = '';
80
-
81
- console.log = function testLog(...texts) {
82
- consoleLogBuffer += texts.join(' ') + '\n';
83
- };
84
-
85
- global.commandLineArguments = ['--config', 'sxy-test-runner.no-initial-tests.config.js'];
86
- watch();
87
- await new Promise(async (resolve, reject) => {
88
- await setTimeout(resolve, 4000);
89
- });
90
- console.log = originalConsoleLog; //console.log('saved console.log output:')
91
- //console.log(consoleLogBuffer)
92
-
93
- await consoleLogBuffer.should.not.include('no tests found');
94
- await consoleLogBuffer.should.not.include('describing');
95
- await consoleLogBuffer.should.include('watching');
96
- });
97
- await mochaIt('setup function and setup file from the config should have run', async function () {
98
- await this.timeout(6000);
99
- global.configBasedSetupFunctionRan = false;
100
- global.watchSetupFileHasRun = false;
101
- const originalConsoleLog = console.log;
102
- let consoleLogBuffer = '';
103
-
104
- console.log = function testLog(...texts) {
105
- consoleLogBuffer += texts.join(' ') + '\n';
106
- };
107
-
108
- global.commandLineArguments = ['--config', 'sxy-test-runner.setup-tasks.config.js'];
109
- watch();
110
- await new Promise(async (resolve, reject) => {
111
- await setTimeout(resolve, 2000);
112
- });
113
- console.log = originalConsoleLog;
114
- await global.configBasedSetupFunctionRan.should.equal(true);
115
- await global.watchSetupFileHasRun.should.equal(true);
116
- });
117
- });
package/dist/config.js DELETED
@@ -1,7 +0,0 @@
1
- export const packageName = 'sxy-test-runner';
2
- export const cliName = 'sxy-test';
3
- export const configFileName = 'sxy-test-runner.config';
4
- export const configLocations = ['', 'config']; // locations where the configs may be placed in proj folder
5
-
6
- export const debugging = false;
7
- export const showTimeProfiling = false;