Files
cypress/cli/test/lib/errors_spec.js
Brian Mann 1d0b35bd47 Cli env var changes (#1734)
* wip [skip ci] update

* wip [skip ci] update test

* [skip ci] fix env var

* bump sinon, create helper utility to always throw when a stub is called without being given stubbed behavior

* update failing specs

* fix some error messages

* update snapshot

* warning -> note, add snapshot tests

* change snapshot os.release, test env vars
2018-05-19 15:37:52 -04:00

28 lines
660 B
JavaScript

require('../spec_helper')
const os = require('os')
const snapshot = require('snap-shot-it')
const { errors, formErrorText } = require(`${lib}/errors`)
const util = require(`${lib}/util`)
describe('errors', function () {
const { missingXvfb } = errors
beforeEach(function () {
sinon.stub(util, 'pkgVersion').returns('1.2.3')
os.platform.returns('test platform')
})
describe('individual', () => {
it('has the following errors', () =>
snapshot(Object.keys(errors))
)
})
context('.errors.formErrorText', function () {
it('returns fully formed text message', () =>
snapshot(formErrorText(missingXvfb))
)
})
})