Skip to content

Commit

Permalink
retest
Browse files Browse the repository at this point in the history
  • Loading branch information
arietrouw committed Mar 1, 2023
1 parent 7503093 commit fe20c08
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ts-scripts-yarn3/src/actions/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export const build = async ({ incremental, jobs, target, verbose, pkg }: BuildPa
}

const result = await runStepsAsync(`Build${incremental ? '-Incremental' : ''} [${pkg ?? 'All'}]`, [
['yarn', ['xy', 'compile', ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
['yarn', ['xy', 'lint', ...pkgOptions, ...verboseOptions, ...incrementalOptions]],
['yarn', ['xy', 'recompile', ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
['yarn', ['xy', 'relint', ...pkgOptions, ...verboseOptions, ...incrementalOptions]],
['yarn', ['xy', 'deps', ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
])
console.log(`${chalk.gray('Built in')} [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`)
Expand Down
1 change: 1 addition & 0 deletions packages/ts-scripts-yarn3/src/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export * from './rebuild'
export * from './recompile'
export * from './reinstall'
export * from './relint'
export * from './retest'
export * from './sonar'
export * from './statics'
export * from './test'
Expand Down
8 changes: 8 additions & 0 deletions packages/ts-scripts-yarn3/src/actions/retest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { runSteps } from '../lib'

export const retest = () => {
return runSteps('Test', [
['yarn', ['jest', '--clearCache']],
['yarn', ['jest', '.']],
])
}
12 changes: 12 additions & 0 deletions packages/ts-scripts-yarn3/src/lib/xy/xyCommonCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
gitlint,
gitlintFix,
license,
retest,
test,
tsconfigGen,
tsconfigGenClean,
Expand Down Expand Up @@ -81,6 +82,17 @@ export const xyCommonCommands = (args: yargs.Argv) => {
process.exitCode = argv.fix ? gitlintFix() : gitlint()
},
)
.command(
'retest',
'Re-Test - Run Jest Tests with cleaned cache',
(yargs) => {
return yargs
},
(argv) => {
if (argv.verbose) console.log('Re-Testing')
process.exitCode = retest()
},
)
.command(
'test',
'Test - Run Jest Tests',
Expand Down

0 comments on commit fe20c08

Please sign in to comment.