Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(angular): re-enable v1 lib test #9494

Merged
merged 1 commit into from Mar 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 24 additions & 23 deletions packages/angular/src/generators/library/library.spec.ts
Expand Up @@ -9,6 +9,7 @@ import {
} from '@nrwl/devkit';
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
import { Linter } from '@nrwl/linter';
import { toNewFormat } from 'nx/src/shared/workspace';
import { createApp } from '../../utils/nx-devkit/testing';
import { UnitTestRunner } from '../../utils/test-runners';
import {
Expand Down Expand Up @@ -75,29 +76,29 @@ describe('lib', () => {
});
});

// describe('workspace v1', () => {
// beforeEach(() => {
// tree = createTreeWithEmptyWorkspace(1);
// });
//
// it('should default to inline project for first project', async () => {
// await runLibraryGeneratorWithOpts({
// standaloneConfig: false,
// });
// const workspaceJsonEntry = toNewFormat(readJson(tree, 'workspace.json'))
// .projects['my-lib'];
// const projectConfig = readProjectConfiguration(tree, 'my-lib');
// expect(projectConfig.root).toEqual('libs/my-lib');
// expect(projectConfig).toMatchObject(workspaceJsonEntry);
// });
//
// it('should throw for standaloneConfig === true', async () => {
// const promise = runLibraryGeneratorWithOpts({
// standaloneConfig: true,
// });
// await expect(promise).rejects.toThrow();
// });
// });
describe('workspace v1', () => {
beforeEach(() => {
tree = createTreeWithEmptyWorkspace(1);
});

it('should default to inline project for first project', async () => {
await runLibraryGeneratorWithOpts({
standaloneConfig: false,
});
const workspaceJsonEntry = toNewFormat(readJson(tree, 'workspace.json'))
.projects['my-lib'];
const projectConfig = readProjectConfiguration(tree, 'my-lib');
expect(projectConfig.root).toEqual('libs/my-lib');
expect(projectConfig).toMatchObject(workspaceJsonEntry);
});

it('should throw for standaloneConfig === true', async () => {
const promise = runLibraryGeneratorWithOpts({
standaloneConfig: true,
});
await expect(promise).rejects.toThrow();
});
});

describe('not nested', () => {
it('should update ng-package.json', async () => {
Expand Down