Skip to content

Commit b4486a5

Browse files
committed
fixup! feat(@schematics/angular): use library builder and add entry-point schematic
1 parent 6737a20 commit b4486a5

2 files changed

Lines changed: 3 additions & 17 deletions

File tree

‎packages/schematics/angular/library/index.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function addLibToWorkspaceFile(
8686
workspace.projects.add({
8787
name: projectName,
8888
root: projectRoot,
89-
sourceRoot: `${projectRoot}/src`,
89+
sourceRoot: projectRoot,
9090
projectType: ProjectType.Library,
9191
prefix: options.prefix,
9292
targets: {
@@ -111,8 +111,6 @@ function addLibToWorkspaceFile(
111111
builder: Builders.BuildUnitTest,
112112
options: {
113113
tsConfig: `${projectRoot}/tsconfig.spec.json`,
114-
// Include spec files from secondary entry points located outside of the source root.
115-
include: ['../**/*.spec.ts'],
116114
},
117115
}
118116
: {

‎tests/e2e/tests/vitest/library.ts‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,9 @@ export default async function (): Promise<void> {
2828
};
2929
});
3030

31-
// 3. Update the component to use SCSS and import the shared file
32-
// Rename CSS to SCSS
33-
await ng('generate', 'component', 'styled-comp', '--project=my-lib', '--style=scss');
34-
35-
await appendToFile(
36-
'projects/my-lib/src/lib/styled-comp/styled-comp.scss',
37-
`
38-
@use 'vars';
39-
p { color: vars.$primary-color; }
40-
`,
41-
);
42-
4331
// Run the library tests
4432
const { stdout } = await ng('test', 'my-lib');
4533

46-
// Expect tests to pass
47-
assert.match(stdout, /passed/, 'Expected library tests to pass.');
34+
// Expect tests to pass (my-lib, styled-comp, and secondary)
35+
assert.match(stdout, /3 passed/, 'Expected 3 library tests to pass.');
4836
}

0 commit comments

Comments
 (0)