Skip to content

Commit 7612a93

Browse files
fix: Added alias for watch-file option (#2182)
1 parent 629aa14 commit 7612a93

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/program.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ Example: $0 --help run.
617617
type: 'boolean',
618618
},
619619
'watch-file': {
620+
alias: ['watch-files'],
620621
describe: 'Reload the extension only when the contents of this' +
621622
' file changes. This is useful if you use a custom' +
622623
' build process for your extension',

tests/functional/test.cli.run.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,30 @@ const EXPECTED_MESSAGE = 'Fake Firefox binary executed correctly.';
1414

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

17-
it('accepts: --no-reload --watch-file --source-dir SRCDIR ' +
18-
'--firefox FXPATH --watch-ignored',
17+
it('accepts: --no-reload --watch-file --watch-files --source-dir ' +
18+
'SRCDIR --firefox FXPATH --watch-ignored',
1919
() => withTempAddonDir(
2020
{addonPath: minimalAddonPath},
2121
(srcDir) => {
2222
const watchedFile = path.join(srcDir, 'watchedFile.txt');
23+
const watchedFilesArr = ['watchedFile1', 'watchedFile2'].map(
24+
(file) => path.join(srcDir, file)
25+
);
2326
const watchIgnoredArr = ['ignoredFile1.txt', 'ignoredFile2.txt'].map(
2427
(file) => path.join(srcDir, file)
2528
);
2629
const watchIgnoredFile = path.join(srcDir, 'ignoredFile3.txt');
2730

2831
fs.writeFileSync(watchedFile, '');
32+
watchedFilesArr.forEach((file) => fs.writeFileSync(file, ''));
2933
watchIgnoredArr.forEach((file) => fs.writeFileSync(file, ''));
3034
fs.writeFileSync(watchIgnoredFile, '');
3135

3236
const argv = [
3337
'run', '--verbose', '--no-reload',
3438
'--source-dir', srcDir,
3539
'--watch-file', watchedFile,
40+
'--watch-files', ...watchedFilesArr,
3641
'--firefox', fakeFirefoxPath,
3742
'--watch-ignored', ...watchIgnoredArr,
3843
'--watch-ignored', watchIgnoredFile,

0 commit comments

Comments
 (0)