Skip to content

Commit

Permalink
test(local-plugin): update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nartc committed Sep 14, 2023
1 parent e198891 commit c3edac5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ const entryPoint = 'entry-point';
describe('convert-entry-point-to-project generator', () => {
let tree: Tree;

beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
});

async function setup(isReady = false) {
tree = createTreeWithEmptyWorkspace();

Expand Down
35 changes: 29 additions & 6 deletions libs/local-plugin/src/generators/entry-point/generator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
import { UnitTestRunner, libraryGenerator } from '@nx/angular/generators';
import { type Tree } from '@nx/devkit';
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
import entryPointGenerator from './generator';

describe('entry-point generator', () => {
// let tree: Tree;
//
// beforeEach(() => {
// tree = createTreeWithEmptyWorkspace();
// });
let tree: Tree;

async function setup() {
tree = createTreeWithEmptyWorkspace();

await libraryGenerator(tree, {
name: 'main-entry',
publishable: true,
importPath: 'main-entry',
routing: false,
spec: false,
skipTests: true,
skipModule: true,
unitTestRunner: UnitTestRunner.None,
});
}

it('should run successfully', async () => {
expect(true).toBeTruthy();
await setup();
await entryPointGenerator(tree, {
name: 'entry-point',
library: 'main-entry',
skipModule: true,
});

expect(tree.exists('main-entry/entry-point/project.json')).toEqual(true);
});
});

0 comments on commit c3edac5

Please sign in to comment.