Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | 1x 1x 1x 1x 1x 6x 1x 1x 6x 6x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | import * as mock from 'mock-fs'; import * as path from 'path'; import {deepStrictEqual, strictEqual} from 'assert'; import {PackageJSON} from './package_json'; const cwd = process.cwd(); const here = (filename: string) => path.join(cwd, filename); describe('PackageJSON', () => { beforeEach(() => mock({ [here('package.json')]: '{}', }) ); afterEach(() => mock.restore()); it('should use name', async () => { const pack = new PackageJSON(); strictEqual(await pack.name, undefined); }); it('should use description', async () => { const pack = new PackageJSON(); strictEqual(await pack.description, undefined); }); it('should use version', async () => { const pack = new PackageJSON(); strictEqual(await pack.version, undefined); }); it('should use main', async () => { const pack = new PackageJSON(); strictEqual(await pack.main, undefined); }); it('should use bin', async () => { const pack = new PackageJSON(); strictEqual(await pack.bin, undefined); }); it('should use dependencies', async () => { const pack = new PackageJSON(); deepStrictEqual(await pack.dependencies, {}); }); }); |