-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): provide a way to handle get unparsed args in the executor
- Loading branch information
Showing
31 changed files
with
454 additions
and
529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { | ||
getPublishedVersion, | ||
isNotWindows, | ||
newProject, | ||
readFile, | ||
readJson, | ||
runCLI, | ||
runCLIAsync, | ||
runCommand, | ||
tmpProjPath, | ||
uniq, | ||
updateFile, | ||
updateProjectConfig, | ||
} from '@nrwl/e2e/utils'; | ||
import { renameSync } from 'fs'; | ||
import { packagesWeCareAbout } from 'nx/src/command-line/report'; | ||
|
||
// | ||
describe('Running targets', () => { | ||
beforeEach(() => newProject()); | ||
|
||
it('should execute long running tasks', async () => { | ||
const myapp = uniq('myapp'); | ||
runCLI(`generate @nrwl/web:app ${myapp}`); | ||
updateProjectConfig(myapp, (c) => { | ||
c.targets['counter'] = { | ||
executor: '@nrwl/workspace:counter', | ||
options: { | ||
to: 2, | ||
}, | ||
}; | ||
return c; | ||
}); | ||
|
||
const success = runCLI(`counter ${myapp} --result=true`); | ||
expect(success).toContain('0'); | ||
expect(success).toContain('1'); | ||
|
||
expect(() => runCLI(`counter ${myapp} --result=false`)).toThrowError(); | ||
}); | ||
|
||
it('should run npm scripts', async () => { | ||
const mylib = uniq('mylib'); | ||
runCLI(`generate @nrwl/node:lib ${mylib}`); | ||
|
||
updateProjectConfig(mylib, (j) => { | ||
delete j.targets; | ||
return j; | ||
}); | ||
|
||
updateFile( | ||
`libs/${mylib}/package.json`, | ||
JSON.stringify({ | ||
name: 'mylib1', | ||
scripts: { 'echo:dev': `echo ECHOED` }, | ||
}) | ||
); | ||
|
||
const { stdout } = await runCLIAsync( | ||
`echo:dev ${mylib} -- positional --a=123 --no-b`, | ||
{ | ||
silent: true, | ||
} | ||
); | ||
expect(stdout).toMatch(/ECHOED positional --a=123 --no-b/); | ||
}, 1000000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
5c49345
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nx-dev – ./
nx-five.vercel.app
nx.dev
nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app