Files
cypress/cli/test/lib/build_spec.js
T
Brian Mann 2333d04a54 secure cookie error crash (#2685)
- fixes #1264 
- fixes #1321 
- fixes #1799  
- fixes #2689
- fixes #2688
- fixes #2687 	
- fixes #2686
2018-11-01 12:34:37 -04:00

44 lines
1.1 KiB
JavaScript

require('../spec_helper')
const fs = require(`${lib}/fs`)
const makeUserPackageFile = require('../../scripts/build')
const snapshot = require('snap-shot-it')
const la = require('lazy-ass')
const is = require('check-more-types')
const R = require('ramda')
const hasVersion = (json) => {
return la(is.semver(json.version), 'cannot find version', json)
}
const hasAuthor = (json) => {
return la(json.author === 'Brian Mann', 'wrong author name', json)
}
const changeVersion = R.assoc('version', 'x.y.z')
describe('package.json build', () => {
beforeEach(function () {
// stub package.json in CLI
// with a few test props
// the rest should come from root package.json file
sinon.stub(fs, 'readJsonAsync').resolves({
name: 'test',
engines: 'test engines',
})
sinon.stub(fs, 'outputJsonAsync').resolves()
})
it('author name and version', () => {
return makeUserPackageFile()
.tap(hasAuthor)
.tap(hasVersion)
})
it('outputs expected properties', () => {
return makeUserPackageFile()
.then(changeVersion)
.then(snapshot)
})
})