Support semver checks
This commit is contained in:
parent
d5ebd70332
commit
3e0dc84eb7
5 changed files with 260 additions and 180 deletions
|
@ -2,6 +2,7 @@ const fs = require('fs')
|
|||
const path = require('path')
|
||||
const yaml = require('js-yaml')
|
||||
const ergogen = require('../../src/ergogen')
|
||||
const version = require('../../package.json').version
|
||||
|
||||
// fixtures
|
||||
const load = name => yaml.safeLoad(fs.readFileSync(
|
||||
|
@ -56,4 +57,13 @@ describe('Interface', function() {
|
|||
])
|
||||
})
|
||||
|
||||
it('engine', async function() {
|
||||
return Promise.all([
|
||||
ergogen.process({'meta.engine': 'invalid'}).should.be.rejectedWith('Invalid'),
|
||||
ergogen.process({'meta.engine': '^0.1.2'}).should.be.rejectedWith('satisfy'),
|
||||
// no "points clause" means we're over the engine check, so it "succeeded"
|
||||
ergogen.process({'meta.engine': `^${version}`}).should.be.rejectedWith('points clause')
|
||||
])
|
||||
})
|
||||
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue