Skip to content

Commit

Permalink
code-quality
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Apr 16, 2021
1 parent f2c3b72 commit bd7e666
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 61 deletions.
40 changes: 0 additions & 40 deletions e2e/typescript-e2e/tests/typescript.spec.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,5 @@
describe('typescript e2e', () => {

it('has a test', () => {
expect(true).toBeTruthy();
})
// it('should create typescript', async (done) => {
// const plugin = uniq('typescript');
// ensureNxProject('@nx-dotnet/typescript', 'dist/packages/typescript');
// await runNxCommandAsync(
// `generate @nx-dotnet/typescript:typescript ${plugin}`
// );

// const result = await runNxCommandAsync(`build ${plugin}`);
// expect(result.stdout).toContain('Executor ran');

// done();
// });

// describe('--directory', () => {
// it('should create src in the specified directory', async (done) => {
// const plugin = uniq('typescript');
// ensureNxProject('@nx-dotnet/typescript', 'dist/packages/typescript');
// await runNxCommandAsync(
// `generate @nx-dotnet/typescript:typescript ${plugin} --directory subdir`
// );
// expect(() =>
// checkFilesExist(`libs/subdir/${plugin}/src/index.ts`)
// ).not.toThrow();
// done();
// });
// });

// describe('--tags', () => {
// it('should add tags to nx.json', async (done) => {
// const plugin = uniq('typescript');
// ensureNxProject('@nx-dotnet/typescript', 'dist/packages/typescript');
// await runNxCommandAsync(
// `generate @nx-dotnet/typescript:typescript ${plugin} --tags e2etag,e2ePackage`
// );
// const nxJson = readJson('nx.json');
// expect(nxJson.projects[plugin].tags).toEqual(['e2etag', 'e2ePackage']);
// done();
// });
// });
});
10 changes: 4 additions & 6 deletions packages/core/src/generators/init/generator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
import { Tree, readProjectConfiguration } from '@nrwl/devkit';
import { Tree } from '@nrwl/devkit';

import generator from './generator';
import { InitGeneratorSchema } from './schema';

describe('init generator', () => {
let appTree: Tree;
const options: InitGeneratorSchema = { name: 'test' };

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

it('should run successfully', async () => {
// await generator(appTree, options);
// const config = readProjectConfiguration(appTree, 'test');
expect(true).toBeTruthy();
await generator(appTree);
const config = appTree.isFile('nx-dotnet.config.js');
expect(config).toBeTruthy();
})
});
16 changes: 1 addition & 15 deletions packages/core/src/generators/init/generator.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
import {
addProjectConfiguration,
formatFiles,
generateFiles,
getWorkspaceLayout,
names,
offsetFromRoot,
Tree,
} from '@nrwl/devkit';
import * as path from 'path';
import { InitGeneratorSchema } from './schema';

interface NormalizedSchema extends InitGeneratorSchema {
projectName: string;
projectRoot: string;
projectDirectory: string;
parsedTags: string[];
}

export default async function (host: Tree) {
const initialized = host.isFile('nx-dotnet.config.ts');
const initialized = host.isFile('nx-dotnet.config.js');
if (initialized) {
return;
}
Expand Down

0 comments on commit bd7e666

Please sign in to comment.