Skip to content

Commit

Permalink
test: repair tests after previous breaking changes
Browse files Browse the repository at this point in the history
BREAKING CHANGE: jasmine is removed

working towards conveyal#318
  • Loading branch information
miles-grant-ibigroup committed Jul 6, 2021
1 parent d6de291 commit e0e41e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
22 changes: 11 additions & 11 deletions __tests__/bin/mastarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ const util = require('../test-utils/util.js')

const mastarm = path.resolve(__dirname, '../../bin/mastarm')

const originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL
const originalTimeout = jest.originalTimeout

describe('mastarm cli', () => {
beforeEach(() => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000
jest.setTimeout(20000)
})
afterEach(() => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout
jest.setTimeout(originalTimeout)
})

it('should display usage with no args', done => {
it('should display usage with no args', (done) => {
exec(`node ${mastarm} --help`, (err, stdout, stderr) => {
expect(err).toBeNull()
expect(stdout).toContain('Usage: mastarm [options] [command]')
Expand All @@ -33,10 +33,10 @@ describe('mastarm cli', () => {
const buildDir = util.buildDir
const mockDir = util.mockDir

beforeEach(done => mkdirp(buildDir, done))
afterEach(done => rimraf(buildDir, done))
beforeEach(() => mkdirp(buildDir))
afterEach((done) => rimraf(buildDir, done))

it('should build a project', done => {
it('should build a project', (done) => {
exec(
`node ${mastarm}-build ${mockDir}/index.js:${buildDir}/index.js ${mockDir}/index.css:${buildDir}/index.css`,
(err, stdout, stderr) => {
Expand All @@ -55,10 +55,10 @@ describe('mastarm cli', () => {
const buildDir = util.buildDir
const mockDir = util.mockDir

beforeEach(done => mkdirp(buildDir, done))
afterEach(done => rimraf(buildDir, done))
beforeEach(() => mkdirp(buildDir))
afterEach((done) => rimraf(buildDir, done))

it('should prepublish a project', done => {
it('should prepublish a project', (done) => {
exec(
`node ${mastarm}-prepublish ${mockDir}:${buildDir}`,
(err, stdout, stderr) => {
Expand All @@ -72,7 +72,7 @@ describe('mastarm cli', () => {
})
})

it('should run lint on a project', done => {
it('should run lint on a project', (done) => {
exec(`${mastarm}-lint lib --quiet`, (err, stdout, stderr) => {
expect(err).toBeNull()
expect(stdout).toBe('')
Expand Down
1 change: 0 additions & 1 deletion __tests__/lib/__snapshots__/load-config.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ Object {
"messages": Object {},
"settings": Object {},
"store": Object {},
"stylePath": null,
}
`;
2 changes: 1 addition & 1 deletion __tests__/lib/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('jest.js', () => {
updateSnapshots: true
})
cfg[JEST_CONFIG_INDEX] = JSON.parse(cfg[JEST_CONFIG_INDEX])
expect(cfg[JEST_CONFIG_INDEX].transform['^.+\\.jsx?$']).toContain(
expect(cfg[JEST_CONFIG_INDEX].transform['^.+\\.(t|j)sx?$']).toContain(
'lib/jest-preprocessor.js'
)
delete cfg[JEST_CONFIG_INDEX].transform
Expand Down

0 comments on commit e0e41e0

Please sign in to comment.