mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
test(tauri.js) add tests for --version option
This commit is contained in:
@@ -33,8 +33,21 @@ describe('[CLI] tauri.js', () => {
|
||||
})
|
||||
it('gets you help', async () => {
|
||||
jest.spyOn(console, 'log')
|
||||
tauri(['icon'])
|
||||
expect(!!console.log.mock.calls[0][0]).toBe(true)
|
||||
jest.clearAllMocks()
|
||||
const tests = ['--help', '-h', 'invalid command']
|
||||
for (const test of tests) {
|
||||
tauri([test])
|
||||
expect(!!console.log.mock.calls[0][0]).toBe(true)
|
||||
jest.clearAllMocks()
|
||||
}
|
||||
})
|
||||
it('gets you version', async () => {
|
||||
jest.spyOn(console, 'log')
|
||||
const tests = ['--version', '-v']
|
||||
const version = require('../../../package.json').version
|
||||
for (const test of tests) {
|
||||
tauri([test])
|
||||
expect(console.log.mock.calls[0][0]).toBe(version)
|
||||
jest.clearAllMocks()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user