fix: error on missing entry

closes #467

closes #464
This commit is contained in:
calebboyd
2018-03-18 16:59:26 -05:00
committed by Caleb Boyd
parent d6d81b9e23
commit b8522b6310
10 changed files with 203 additions and 229 deletions
+1
View File
@@ -0,0 +1 @@
module.exports = 'abc'
+1
View File
@@ -0,0 +1 @@
console.log('hello world', require('./dependency'))
+1 -1
View File
@@ -1,3 +1,3 @@
{
"main": "entry-file.js"
"main": "entry.js"
}
+5 -5
View File
@@ -15,15 +15,15 @@ describe('options', () => {
expect(options.input).to.equal(path.resolve('./index.js'))
})
it('should resolve pathed options against cwd', () => {
const cwd = '/a/b/c'
const cwd = path.join(process.cwd(), 'test/fixture')
const options = normalizeOptions({
cwd,
input: '123.js',
input: 'entry',
output: 'abc',
temp: './d'
})
expect(options.temp).to.equal(path.resolve(cwd, './d'))
expect(options.input).to.equal(path.resolve(cwd, '123.js'))
expect(options.input).to.equal(path.resolve(cwd, 'entry.js'))
expect(options.output).to.equal(path.resolve(cwd, `abc${ext}`))
})
})
@@ -36,9 +36,9 @@ describe('options', () => {
})
it('should default to the input file name if not index', () => {
const options = normalizeOptions({
input: 'src/folder/app.js'
input: './test/fixture'
})
expect(options.output).to.equal(path.resolve(`./app${ext}`))
expect(options.output).to.equal(path.resolve(`./entry${ext}`))
})
it('should default to the folder/project name if filename is index', () => {
const options = normalizeOptions()
+2 -2
View File
@@ -1,8 +1,8 @@
import { padRight, isWindows } from '../src/util'
import { expect } from 'chai'
import { blue as b } from 'chalk'
import chalk from 'chalk'
import { getTarget, NexeTarget } from '../src/target'
const b = chalk.blue
const arch = process.arch === 'ia32' ? 'x86' : process.arch
describe('Targets', () => {