Skip to content

Commit

Permalink
fix: remove no-bundle from test build and fix flag
Browse files Browse the repository at this point in the history
We run build before test but pass `--no-bundle` on the assumption
that a project build command is `aegir build`.  Passing `--no-bundle`
skips making a minified build for a tiny speedup.

If the project build command isn't `aegir build` this can break things
so remove the optimisation.

Also build by default before test and fix the problem whereby the build
flag was being ignored for typescript projects.

Fixes: #975
  • Loading branch information
achingbrain committed Jun 23, 2022
1 parent d7608ad commit 9360526
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/config/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const defaults = {
debug: false,
// test cmd options
test: {
build: false,
build: true,
runner: 'node',
target: ['node', 'browser', 'webworker'],
watch: false,
Expand Down
5 changes: 2 additions & 3 deletions src/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import node from './node.js'
import browser from './browser.js'
import electron from './electron.js'
import rn from './react-native.js'
import { isTypescript } from '../utils.js'
import { execa } from 'execa'

/**
Expand All @@ -20,13 +19,13 @@ const TASKS = [
/**
* @param {TestOptions & GlobalOptions} ctx
*/
enabled: (ctx) => isTypescript || ctx.build === true,
enabled: (ctx) => ctx.build === true,

/**
* @param {BuildOptions & GlobalOptions} ctx
*/
task: async (ctx) => {
await execa('npm', ['run', 'build', '--if-present', '--', '--no-bundle'], {
await execa('npm', ['run', 'build', '--if-present'], {
stdio: 'inherit'
})
}
Expand Down

0 comments on commit 9360526

Please sign in to comment.