Skip to content

Commit

Permalink
Fix failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
octogonz committed Feb 11, 2023
1 parent acfaa02 commit 8580a84
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libraries/rush-sdk/config/heft.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
},
{
"actionKind": "runScript",
"heftEvent": "post-build",
"heftEvent": "bundle",
"actionId": "generate-stubs",
"scriptPath": "./lib-shim/generate-stubs.js"
}
Expand Down
5 changes: 5 additions & 0 deletions libraries/rush-sdk/config/typescript.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/heft/typescript.schema.json",

"emitFolderNameForTests": "lib-shim"
}
9 changes: 7 additions & 2 deletions libraries/rush-sdk/src/test/script.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as path from 'path';
import { Executable } from '@rushstack/node-core-library';

const rushSdkPath: string = path.join(__dirname, '../../lib/index.js');
const rushSdkPath: string = path.join(__dirname, '../../lib-shim/index.js');
const sandboxRepoPath: string = `${__dirname}/sandbox`;
const mockPackageFolder: string = `${sandboxRepoPath}/mock-package`;
const mockRushLibPath: string = `${__dirname}/fixture/mock-rush-lib.js`;
Expand Down Expand Up @@ -32,7 +32,12 @@ console.log(require(${JSON.stringify(rushSdkPath)}));
}
);
expect(result.stderr.trim()).toMatchInlineSnapshot(`""`);
expect(result.stdout.trim()).toMatchInlineSnapshot(`"{ foo: [Getter] }"`);
expect(result.stdout.trim()).toMatchInlineSnapshot(`
"{
_rushSdk_loadInternalModule: [Function: _rushSdk_loadInternalModule],
foo: [Getter]
}"
`);
expect(result.status).toBe(0);
});
});

0 comments on commit 8580a84

Please sign in to comment.