Skip to content

Commit

Permalink
πŸ— gulp ava --watch (#33015)
Browse files Browse the repository at this point in the history
1. Pass `--watch` for `ava --watch`
2. Use `npx ava`
  • Loading branch information
alanorozco committed Mar 2, 2021
1 parent c2a8827 commit 048d59a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions build-system/tasks/ava.js
Expand Up @@ -15,22 +15,33 @@
*/
'use strict';

const argv = require('minimist')(process.argv.slice(2));
const {execOrDie} = require('../common/exec');

/**
* Runs ava tests.
*/
async function ava() {
const avaCli = 'node_modules/ava/cli.js';
const testFiles = [
'build-system/tasks/get-zindex/get-zindex.test.js',
'build-system/tasks/prepend-global/prepend-global.test.js',
].join(' ');
execOrDie(`${avaCli} ${testFiles} --color --fail-fast`);
];
execOrDie(
[
'npx ava',
...testFiles,
'--color --fail-fast',
argv.watch ? '--watch' : '',
].join(' ')
);
}

module.exports = {
ava,
};

ava.description = "Runs ava tests for AMP's tasks";

ava.flags = {
'watch': ' Watches for changes',
};

0 comments on commit 048d59a

Please sign in to comment.