itee-tasks 1.0.4 → 1.0.6

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 (28) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/configs/tests/benchmarks/compute-benchmarks.conf.mjs +3 -23
  3. package/configs/tests/bundlings/check-bundling-from-esm-files-direct.conf.mjs +43 -37
  4. package/configs/tests/bundlings/check-bundling-from-esm-files-import.conf.mjs +40 -34
  5. package/configs/tests/units/compute-unit-tests.conf.mjs +2 -22
  6. package/package.json +1 -1
  7. package/sources/_utils.mjs +54 -35
  8. package/sources/builds/build.task.mjs +7 -10
  9. package/sources/cleans/clean.task.mjs +6 -10
  10. package/sources/docs/doc.task.mjs +7 -8
  11. package/sources/helps/help.task.mjs +4 -3
  12. package/sources/lints/lint.task.mjs +8 -9
  13. package/sources/refresh.mjs +5 -5
  14. package/sources/releases/release.task.mjs +4 -3
  15. package/sources/tests/benchmarks/compute-benchmarks.task.mjs +32 -20
  16. package/sources/tests/benchmarks/run-benchmarks-for-backend.task.mjs +4 -3
  17. package/sources/tests/benchmarks/run-benchmarks-for-frontend.task.mjs +6 -10
  18. package/sources/tests/benchmarks/run-benchmarks.task.mjs +6 -11
  19. package/sources/tests/bundlings/check-bundling-from-esm-build-import.task.mjs +5 -9
  20. package/sources/tests/bundlings/check-bundling-from-esm-files-direct.task.mjs +27 -21
  21. package/sources/tests/bundlings/check-bundling-from-esm-files-import.task.mjs +29 -22
  22. package/sources/tests/bundlings/check-bundling.task.mjs +4 -3
  23. package/sources/tests/run-tests.task.mjs +4 -3
  24. package/sources/tests/units/compute-unit-tests.task.mjs +31 -19
  25. package/sources/tests/units/run-unit-tests-for-backend.task.mjs +4 -3
  26. package/sources/tests/units/run-unit-tests-for-frontend.task.mjs +6 -10
  27. package/sources/tests/units/run-unit-tests.task.mjs +6 -11
  28. package/configs/tests/bundlings/check-bundling.conf.mjs +0 -25
@@ -2,6 +2,7 @@ import colors from 'ansi-colors'
2
2
  import { spawn } from 'child_process'
3
3
  import log from 'fancy-log'
4
4
  import { existsSync } from 'fs'
5
+ import { basename } from 'node:path'
5
6
  import { join } from 'path'
6
7
  import {
7
8
  logLoadingTask,
@@ -10,6 +11,8 @@ import {
10
11
  packageTestsUnitsDirectory
11
12
  } from '../../_utils.mjs'
12
13
 
14
+ logLoadingTask( import.meta.filename )
15
+
13
16
  const {
14
17
  red,
15
18
  yellow,
@@ -38,10 +41,8 @@ const runUnitTestsForBackendTask = ( done ) => {
38
41
  } )
39
42
 
40
43
  }
41
- runUnitTestsForBackendTask.displayName = 'run-unit-tests-for-backend'
44
+ runUnitTestsForBackendTask.displayName = basename( import.meta.filename, '.task.mjs' )
42
45
  runUnitTestsForBackendTask.description = 'Will run unit tests with node'
43
46
  runUnitTestsForBackendTask.flags = null
44
47
 
45
- logLoadingTask( import.meta.filename, runUnitTestsForBackendTask )
46
-
47
48
  export { runUnitTestsForBackendTask }
@@ -1,16 +1,14 @@
1
1
  import { startTestRunner } from '@web/test-runner'
2
2
  import colors from 'ansi-colors'
3
- import { join } from 'path'
3
+ import { basename } from 'node:path'
4
4
  import {
5
- getConfigurationFrom,
6
- getConfigurationPathFor,
5
+ getTaskConfigurationFor,
7
6
  logLoadingTask
8
7
  } from '../../_utils.mjs'
9
8
 
10
- const { red } = colors
9
+ logLoadingTask( import.meta.filename )
11
10
 
12
- const configurationLocation = join( 'tests', 'units', 'run-unit-tests-for-frontend.conf.mjs' )
13
- const configurationPath = getConfigurationPathFor( configurationLocation )
11
+ const { red } = colors
14
12
 
15
13
  /**
16
14
  * @description Will run unit tests with web-test-runner
@@ -18,7 +16,7 @@ const configurationPath = getConfigurationPathFor( configurationLocation )
18
16
  const runUnitTestsForFrontendTask = () => {
19
17
  return new Promise( async ( resolve, reject ) => {
20
18
 
21
- const configuration = await getConfigurationFrom( configurationPath )
19
+ const configuration = await getTaskConfigurationFor( import.meta.filename )
22
20
  const testRunner = await startTestRunner( {
23
21
  config: configuration,
24
22
  readCliArgs: false,
@@ -43,10 +41,8 @@ const runUnitTestsForFrontendTask = () => {
43
41
 
44
42
  } )
45
43
  }
46
- runUnitTestsForFrontendTask.displayName = 'run-unit-tests-for-frontend'
44
+ runUnitTestsForFrontendTask.displayName = basename( import.meta.filename, '.task.mjs' )
47
45
  runUnitTestsForFrontendTask.description = 'Will run unit tests with web-test-runner'
48
46
  runUnitTestsForFrontendTask.flags = null
49
47
 
50
- logLoadingTask( import.meta.filename, runUnitTestsForFrontendTask, configurationPath )
51
-
52
48
  export { runUnitTestsForFrontendTask }
@@ -1,21 +1,16 @@
1
- import { join } from 'path'
1
+ import { basename } from 'node:path'
2
2
  import {
3
- getConfigurationFrom,
4
- getConfigurationPathFor,
3
+ getTaskConfigurationFor,
5
4
  logLoadingTask,
6
5
  serializeTasksFrom
7
- } from '../../_utils.mjs'
6
+ } from '../../_utils.mjs'
8
7
 
8
+ logLoadingTask( import.meta.filename )
9
9
 
10
- const configurationLocation = join( 'tests', 'units', 'run-unit-tests.conf.mjs' )
11
- const configurationPath = getConfigurationPathFor( configurationLocation )
12
- const configuration = await getConfigurationFrom( configurationPath )
13
-
10
+ const configuration = await getTaskConfigurationFor( import.meta.filename )
14
11
  const runUnitTestsTask = await serializeTasksFrom( configuration )
15
- runUnitTestsTask.displayName = 'run-unit-tests'
12
+ runUnitTestsTask.displayName = basename( import.meta.filename, '.task.mjs' )
16
13
  runUnitTestsTask.description = 'Will run unit tests in back and front environments.'
17
14
  runUnitTestsTask.flags = null
18
15
 
19
- logLoadingTask( import.meta.filename, runUnitTestsTask, configurationPath )
20
-
21
16
  export { runUnitTestsTask }
@@ -1,25 +0,0 @@
1
- import { glob } from 'glob'
2
- import {
3
- basename,
4
- join,
5
- normalize
6
- } from 'path'
7
- import {
8
- packageName,
9
- packageSourcesDirectory
10
- } from '../../../sources/_utils.mjs'
11
-
12
- const pattern = join( packageSourcesDirectory, '**' )
13
- const filePathsToIgnore = [
14
- `${ packageName }.js`
15
- ]
16
-
17
- export default glob.sync( pattern )
18
- .map( filePath => normalize( filePath ) )
19
- .filter( filePath => {
20
- const fileName = basename( filePath )
21
- const isJsFile = fileName.endsWith( '.js' )
22
- const isNotPrivateFile = !fileName.startsWith( '_' )
23
- const isNotIgnoredFile = !filePathsToIgnore.includes( fileName )
24
- return isJsFile && isNotPrivateFile && isNotIgnoredFile
25
- } )