UNPKG

@nestjsplus/lib-starter

Version:

Boilerplate for building installable NestJS libraries

19 lines (18 loc) 828 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const schematics_1 = require("@angular-devkit/schematics"); const testing_1 = require("@angular-devkit/schematics/testing"); const path = require("path"); const collectionPath = path.join(__dirname, '../collection.json'); describe('gen-env schematic', () => { it('creates env file in specified folder', () => { const runner = new testing_1.SchematicTestRunner('schematics', collectionPath); const options = { testMessage: 'foo', envDir: 'bar', }; const tree = runner.runSchematic('gen-env', options, schematics_1.Tree.empty()); expect(tree.files).toEqual(['/bar/development.env']); expect(tree.readContent('/bar/development.env')).toContain(options.testMessage); }); });