UNPKG

ohayolibs

Version:

Ohayo is a set of essential modules for ohayojp.

26 lines (20 loc) 868 B
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; import { createOhayoApp } from '../utils/testing'; describe('NgOhayoSchematic: plugin: codeStyle', () => { let runner: SchematicTestRunner; let tree: UnitTestTree; beforeEach(async () => ({ runner, tree } = await createOhayoApp({ codeStyle: true }))); describe('when add', () => { it(`should add precommit`, () => { const json = JSON.parse(tree.readContent('package.json')); expect(json.husky).not.toBeUndefined(); }); }); describe('when remove', () => { beforeEach(async () => runner.runSchematicAsync('plugin', { name: 'codeStyle', type: 'remove' }, tree).toPromise()); it(`should remove precommit`, () => { const json = JSON.parse(tree.readContent('package.json')); expect(json.husky).toBeUndefined(); }); }); });