-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`turbo-ignore` by default specifies `build` as the task it will run. This makes it possible to specify an alternative task name as the entry point. This enables `npx turbo-ignore --task="workspace#build"`, for example.
- Loading branch information
1 parent
97baee4
commit d3c4c6f
Showing
7 changed files
with
107 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { getTask } from "../src/getTask"; | ||
import { spyConsole, validateLogs } from "./test-utils"; | ||
|
||
describe("getWorkspace()", () => { | ||
const mockConsole = spyConsole(); | ||
it("getTask defaults to build", async () => { | ||
expect(getTask({})).toEqual("build"); | ||
validateLogs( | ||
['using "build" as the task as it was unspecified'], | ||
mockConsole.log | ||
); | ||
}); | ||
|
||
it("getTask returns a quoted task if user-supplied", async () => { | ||
expect( | ||
getTask({ | ||
task: "workspace#task", | ||
}) | ||
).toEqual(`"workspace#task"`); | ||
validateLogs( | ||
['using "workspace#task" as the task from the arguments'], | ||
mockConsole.log | ||
); | ||
}); | ||
}); |
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,13 @@ | ||
import { info } from "./logger"; | ||
import { TurboIgnoreArgs } from "./types"; | ||
|
||
export function getTask(args: TurboIgnoreArgs): string | null { | ||
if (args.task) { | ||
info(`using "${args.task}" as the task from the arguments`); | ||
return `"${args.task}"`; | ||
} | ||
|
||
info('using "build" as the task as it was unspecified'); | ||
|
||
return "build"; | ||
} |
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