Skip to content

Commit

Permalink
fixing up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GantMan committed Aug 10, 2018
1 parent f3b32d5 commit 2edb198
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions __tests__/command_helpers/getSolidaritySettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,31 @@ describe('basic getSolidaritySettings', () => {
})
})

// describe('w/ failure', () => {
// test('getSolidaritySettings can fail', async () => {
// await expect(async () => {
// process.chdir('__tests__')
// await getSolidaritySettings(context)
// }).toThrow()
// process.chdir('../')
// })

// test('getSolidaritySettings can warn with missing requirements', async () => {
// await expect(async () => {
// process.chdir('__tests__/sandbox/solidarity_broken')
// await getSolidaritySettings(context)
// }).toThrowError('ERROR: Found, but no requirements key. Please validate your solidarity file')
// process.chdir('../../../')
// })
// })
describe('w/ failure', () => {
test('getSolidaritySettings can fail', async () => {

// Original sync style
// expect(async () => {
// process.chdir('__tests__')
// getSolidaritySettings(context)
// }).toThrow()
// process.chdir('../')

process.chdir('__tests__')
await expect(getSolidaritySettings(context))
.rejects
.toThrow()
process.chdir('../')
})

test('getSolidaritySettings can warn with missing requirements', async () => {
process.chdir('__tests__/sandbox/solidarity_broken')
await expect(getSolidaritySettings(context))
.rejects
.toThrow()
process.chdir('../../../')
})
})
})

describe('parameterized getSolidaritySettings', () => {
Expand Down

0 comments on commit 2edb198

Please sign in to comment.