-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,37 @@ | ||
import { expect } from 'chai'; | ||
import mockFs from 'mock-fs'; | ||
|
||
import { main, STATUS_SUCCESS } from '../src/app'; | ||
import { describeLeaks } from './helpers/async'; | ||
import { describeLeaks, itLeaks } from './helpers/async'; | ||
|
||
describeLeaks('main app', async () => { | ||
xit('completion should succeed', async () => { | ||
itLeaks('completion should succeed', async () => { | ||
const status = await main(['node', 'test', 'complete']); | ||
expect(status).to.equal(STATUS_SUCCESS); | ||
}); | ||
|
||
itLeaks('should list rules and exit', async () => { | ||
const status = await main(['node', 'test', 'list']); | ||
expect(status).to.equal(STATUS_SUCCESS); | ||
}); | ||
|
||
itLeaks('should load the source', async () => { | ||
mockFs({ | ||
'docs': { | ||
'config.yml': 'data: {logger: {level: debug, name: test, stream: !stream stderr}}', | ||
}, | ||
'test.yml': 'hello world', | ||
}); | ||
|
||
const status = await main([ | ||
'node', 'test', | ||
'--config-path', 'docs', | ||
'--config-name', 'config.yml', | ||
'--source', 'test.yml', | ||
]); | ||
|
||
mockFs.restore(); | ||
|
||
expect(status).to.equal(STATUS_SUCCESS); | ||
}); | ||
}); |