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.
- package/CHANGELOG.md +11 -0
- package/configs/tests/benchmarks/compute-benchmarks.conf.mjs +3 -23
- package/configs/tests/bundlings/check-bundling-from-esm-files-direct.conf.mjs +43 -37
- package/configs/tests/bundlings/check-bundling-from-esm-files-import.conf.mjs +40 -34
- package/configs/tests/units/compute-unit-tests.conf.mjs +2 -22
- package/package.json +1 -1
- package/sources/_utils.mjs +54 -35
- package/sources/builds/build.task.mjs +7 -10
- package/sources/cleans/clean.task.mjs +6 -10
- package/sources/docs/doc.task.mjs +7 -8
- package/sources/helps/help.task.mjs +4 -3
- package/sources/lints/lint.task.mjs +8 -9
- package/sources/refresh.mjs +5 -5
- package/sources/releases/release.task.mjs +4 -3
- package/sources/tests/benchmarks/compute-benchmarks.task.mjs +32 -20
- package/sources/tests/benchmarks/run-benchmarks-for-backend.task.mjs +4 -3
- package/sources/tests/benchmarks/run-benchmarks-for-frontend.task.mjs +6 -10
- package/sources/tests/benchmarks/run-benchmarks.task.mjs +6 -11
- package/sources/tests/bundlings/check-bundling-from-esm-build-import.task.mjs +5 -9
- package/sources/tests/bundlings/check-bundling-from-esm-files-direct.task.mjs +27 -21
- package/sources/tests/bundlings/check-bundling-from-esm-files-import.task.mjs +29 -22
- package/sources/tests/bundlings/check-bundling.task.mjs +4 -3
- package/sources/tests/run-tests.task.mjs +4 -3
- package/sources/tests/units/compute-unit-tests.task.mjs +31 -19
- package/sources/tests/units/run-unit-tests-for-backend.task.mjs +4 -3
- package/sources/tests/units/run-unit-tests-for-frontend.task.mjs +6 -10
- package/sources/tests/units/run-unit-tests.task.mjs +6 -11
- 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 = '
|
|
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 {
|
|
3
|
+
import { basename } from 'node:path'
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
getConfigurationPathFor,
|
|
5
|
+
getTaskConfigurationFor,
|
|
7
6
|
logLoadingTask
|
|
8
7
|
} from '../../_utils.mjs'
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
logLoadingTask( import.meta.filename )
|
|
11
10
|
|
|
12
|
-
const
|
|
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
|
|
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 = '
|
|
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 {
|
|
1
|
+
import { basename } from 'node:path'
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
getConfigurationPathFor,
|
|
3
|
+
getTaskConfigurationFor,
|
|
5
4
|
logLoadingTask,
|
|
6
5
|
serializeTasksFrom
|
|
7
|
-
}
|
|
6
|
+
} from '../../_utils.mjs'
|
|
8
7
|
|
|
8
|
+
logLoadingTask( import.meta.filename )
|
|
9
9
|
|
|
10
|
-
const
|
|
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 = '
|
|
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
|
-
} )
|