Skip to content

Commit

Permalink
build(integration-external.test.ts): ensure proper cwd is used for ex…
Browse files Browse the repository at this point in the history
…ecuting externals
  • Loading branch information
Xunnamius committed Feb 22, 2021
1 parent 0bb1e32 commit 31c1d5b
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions test/integration-external.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ beforeAll(async () => {
it(`runs silent by default`, async () => {
expect.hasAssertions();

await withMockedFixture(async () => {
const { code, stdout, stderr } = await runExternal();
await withMockedFixture(async ({ root }) => {
const { code, stdout, stderr } = await runExternal(undefined, { cwd: root });

expect(code).toBe(0);
expect(stdout).toBeEmpty();
Expand All @@ -52,23 +52,10 @@ it(`runs silent by default`, async () => {
it(`is verbose when DEBUG='${debugId}'`, async () => {
expect.hasAssertions();

await withMockedFixture(async () => {
await withMockedFixture(async ({ root }) => {
const { code, stdout, stderr } = await runExternal(undefined, {
env: { DEBUG: debugId }
});

expect(code).toBe(0);
expect(stdout).toBeEmpty();
expect(stderr).toStrictEqual(expect.stringContaining('execution complete'));
});
});

it(`is verbose when DEBUG='${debugId}'`, async () => {
expect.hasAssertions();

await withMockedFixture(async () => {
const { code, stdout, stderr } = await runExternal(undefined, {
env: { DEBUG: debugId }
env: { DEBUG: debugId },
cwd: root
});

expect(code).toBe(0);
Expand Down

0 comments on commit 31c1d5b

Please sign in to comment.