Skip to content

Commit

Permalink
chore(js): update js plugin unit tests to use "as-provided" option wh…
Browse files Browse the repository at this point in the history
…en generating apps/libs (#18894)
  • Loading branch information
jaysoo authored Aug 29, 2023
1 parent da2a08e commit 74c812e
Show file tree
Hide file tree
Showing 4 changed files with 251 additions and 191 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ describe('convert to swc', () => {
};

beforeAll(() => {
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write('/apps/.gitignore', '');
tree.write('/libs/.gitignore', '');
tree = createTreeWithEmptyWorkspace();
tree.write('/.gitignore', '');
tree.write('/.gitignore', '');
});

it('should convert tsc to swc', async () => {
await jsLibraryGenerator(tree, {
...defaultLibGenerationOptions,
name: 'tsc-lib',
bundler: 'tsc',
projectNameAndRootFormat: 'as-provided',
});

expect(
Expand All @@ -49,7 +50,7 @@ describe('convert to swc', () => {
)
).toEqual(true);
expect(tree.read('package.json', 'utf-8')).toContain('@swc/core');
expect(tree.read('libs/tsc-lib/package.json', 'utf-8')).toContain(
expect(tree.read('tsc-lib/package.json', 'utf-8')).toContain(
'@swc/helpers'
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ if (swcJestConfig.swcrc === undefined) {
module.exports = {
displayName: 'my-lib',
preset: '../../jest.preset.js',
preset: '../jest.preset.js',
transform: {
'^.+\\\\.[tj]s$': ['@swc/jest', swcJestConfig],
},
moduleFileExtensions: ['ts', 'js', 'html'],
testEnvironment: 'jsdom',
coverageDirectory: '../../coverage/libs/my-lib',
coverageDirectory: '../coverage/my-lib',
};
"
`;
Loading

0 comments on commit 74c812e

Please sign in to comment.