mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-26 08:59:26 -05:00
fbd523615e
* temp 07/01/19 [skip ci] main lint files * use lint-staged scripts * fix all auto-fixable eslint errors * manually fix lint issues in files * temp 07/01/19 [skip ci] * bump eslint plugin versions, update circle.yml * [lint fix] remaining js files * update vscode/settings.json * add back stop-only * use stop-only for linting .onlys * fix verify_spec, build_spec * update json plugin * relint & apply corrections * fix appveyor.yml not cleansing env vars (very bad) * dont echo commit message in appveyor script * retry build & * re-add & upgrade lint-staged * update contributing docs * only let stop-only catch staged changes
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
require('../spec_helper')
|
|
|
|
const fs = require(`${lib}/fs`)
|
|
const makeUserPackageFile = require('../../scripts/build')
|
|
const snapshot = require('../support/snapshot')
|
|
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)
|
|
})
|
|
})
|