it('npmconfig is always absolute', () => { results = makeCreateContext(argv, { npmconfig: '~/.npmconfig', presets: ['nextjs'] }); assume(results.npmconfig).includes('/.npmconfig'); assume(path.isAbsolute(results.npmconfig)).true(); });
describe('without <appname>', () => { it('should exit(2)', assumeGasketExec({ argv: ['create'], assert: ({ code }) => assume(code).equals(2) })); it('should output useful help', assumeGasketExec({ argv: ['create'], assert: ({ stderr, stdout }) => { assume(stdout).equals(''); assume(stderr).includes('Missing 1 required arg'); assume(stderr).includes('appname'); } })); });
it('ignores unexpected fields', () => { assume(() => pkg.add('bogus')).does.not.throw(); assume(pkg).not.includes('bogus'); });
describe('ensureAbsolute', () => { it('transforms tildy paths to absolute', () => { const filepath = '~/.my-file'; const result = ensureAbsolute(filepath); assume(path.isAbsolute(result)).true(); assume(result).not.includes('~'); }); it('transforms relative paths to absolute', () => { const filepath = '../.my-file'; const result = ensureAbsolute(filepath); assume(path.isAbsolute(result)).true(); assume(result).not.includes('..'); }); it('does not transform absolute path', () => { const filepath = '/path/to/.my-file'; const result = ensureAbsolute(filepath); assume(path.isAbsolute(result)).true(); assume(result).equal(filepath); }); });
it('npmconfig is always absolute', () => { results = makeCreateContext(argv, { npmconfig: '~/.npmconfig', presets: ['nextjs'] }); assume(results.npmconfig).includes('/.npmconfig'); assume(path.isAbsolute(results.npmconfig)).true(); });
it('ignores unexpected fields', () => { assume(() => pkg.add('bogus')).does.not.throw(); assume(pkg).not.includes('bogus'); });
describe('without <appname>', () => { it('should exit(2)', assumeGasketExec({ argv: ['create'], assert: ({ code }) => assume(code).equals(2) })); it('should output useful help', assumeGasketExec({ argv: ['create'], assert: ({ stderr, stdout }) => { assume(stdout).equals(''); assume(stderr).includes('Missing 1 required arg'); assume(stderr).includes('appname'); } })); });