@nestjsplus/lib-starter
Version:
Boilerplate for building installable NestJS libraries
22 lines (18 loc) • 725 B
text/typescript
import { Tree } from '@angular-devkit/schematics';
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
import * as path from 'path';
const collectionPath = path.join(__dirname, '../collection.json');
describe('gen-env schematic', () => {
it('creates env file in specified folder', () => {
const runner = new SchematicTestRunner('schematics', collectionPath);
const options = {
testMessage: 'foo',
envDir: 'bar',
};
const tree = runner.runSchematic('gen-env', options, Tree.empty());
expect(tree.files).toEqual(['/bar/development.env']);
expect(tree.readContent('/bar/development.env')).toContain(
options.testMessage,
);
});
});