Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/program.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ Example: $0 --help run.
type: 'boolean',
},
'watch-file': {
alias: ['watch-files'],
describe: 'Reload the extension only when the contents of this' +
' file changes. This is useful if you use a custom' +
' build process for your extension',
Expand Down
9 changes: 7 additions & 2 deletions tests/functional/test.cli.run.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,30 @@ const EXPECTED_MESSAGE = 'Fake Firefox binary executed correctly.';

describe('web-ext run', () => {

it('accepts: --no-reload --watch-file --source-dir SRCDIR ' +
'--firefox FXPATH --watch-ignored',
it('accepts: --no-reload --watch-file --watch-files --source-dir ' +
'SRCDIR --firefox FXPATH --watch-ignored',
() => withTempAddonDir(
{addonPath: minimalAddonPath},
(srcDir) => {
const watchedFile = path.join(srcDir, 'watchedFile.txt');
const watchedFilesArr = ['watchedFile1', 'watchedFile2'].map(
(file) => path.join(srcDir, file)
);
const watchIgnoredArr = ['ignoredFile1.txt', 'ignoredFile2.txt'].map(
(file) => path.join(srcDir, file)
);
const watchIgnoredFile = path.join(srcDir, 'ignoredFile3.txt');

fs.writeFileSync(watchedFile, '');
watchedFilesArr.forEach((file) => fs.writeFileSync(file, ''));
watchIgnoredArr.forEach((file) => fs.writeFileSync(file, ''));
fs.writeFileSync(watchIgnoredFile, '');

const argv = [
'run', '--verbose', '--no-reload',
'--source-dir', srcDir,
'--watch-file', watchedFile,
'--watch-files', ...watchedFilesArr,
'--firefox', fakeFirefoxPath,
'--watch-ignored', ...watchIgnoredArr,
'--watch-ignored', watchIgnoredFile,
Expand Down