Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Badisi committed Aug 14, 2024
1 parent b21da68 commit 5bf1074
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions projects/lib/specs/angular.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,20 @@ const expectAddToNgModule = async (

it('rule: removeAngularJsonAsset(string)', async () => {
const project = await getProjectFromWorkspace(tree, appTest1.name);
let asset = `${project.root}/src/favicon.ico`;
if (asset.startsWith('/') || asset.startsWith('\\')) {
asset = asset.substring(1, asset.length);
let input = `${project.root}/public`;
if (input.startsWith('/') || input.startsWith('\\')) {
input = input.substring(1, input.length);
}
const asset = { glob: '**/*', input };

// Before
expect(getValues(tree, 'build', 'assets')).toContain(asset);
expect(getValues(tree, 'test', 'assets')).toContain(asset);
expect(getValues(tree, 'build', 'assets')).toContain(jasmine.objectContaining(asset));
expect(getValues(tree, 'test', 'assets')).toContain(jasmine.objectContaining(asset));

// After
await callRule(removeAngularJsonAsset(asset, appTest1.name), tree);
expect(getValues(tree, 'build', 'assets')).not.toContain(asset);
expect(getValues(tree, 'test', 'assets')).not.toContain(asset);
expect(getValues(tree, 'build', 'assets')).not.toContain(jasmine.objectContaining(asset));
expect(getValues(tree, 'test', 'assets')).not.toContain(jasmine.objectContaining(asset));

// Twice (expect no error)
const test$ = callRule(removeAngularJsonAsset(asset, appTest1.name), tree);
Expand Down

0 comments on commit 5bf1074

Please sign in to comment.