-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
a5e3335
commit 8fe7ed0
Showing
4 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`end-to-end integration prints tool version with arument -v 1`] = ` | ||
"name: testLinks | ||
version: 1.0.0" | ||
`; | ||
|
||
exports[`end-to-end integration prints url information with a path 1`] = `"https://github.com is good."`; | ||
|
||
exports[`end-to-end integration prints url information with ignore arugment 1`] = ` | ||
"This is invalid. It doesn't use http:// or https:// | ||
<html> | ||
</html> | ||
" | ||
`; | ||
|
||
exports[`end-to-end integration prints url information with path and json output 1`] = `"{\\"url\\":\\"https://github.com\\",\\"status\\":200}"`; | ||
|
||
exports[`end-to-end integration prints url information with two path 1`] = ` | ||
"https://github.com is good. | ||
https://github.com is good." | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* eslint-disable no-undef */ | ||
const execa = require('execa'); | ||
const { describe, test, expect } = require('@jest/globals'); | ||
expect.addSnapshotSerializer(require('jest-snapshot-serializer-ansi')); | ||
|
||
describe('end-to-end integration', () => { | ||
test('prints tool version with arument -v', async () => { | ||
const { stdout, stderr } = await execa('node', ['index', '-v']); | ||
expect(stdout).toMatchSnapshot(); | ||
expect(stderr).toEqual(''); | ||
}); | ||
|
||
test('prints url information with a path', async () => { | ||
const { stdout, stderr } = await execa('node', ['index', 'test4.txt']); | ||
expect(stdout).toMatchSnapshot(); | ||
expect(stderr).toEqual(''); | ||
}); | ||
|
||
test('prints url information with two path', async () => { | ||
const { stdout, stderr } = await execa('node', [ | ||
'index', | ||
'test4.txt', | ||
'test5.html', | ||
]); | ||
expect(stdout).toMatchSnapshot(); | ||
expect(stderr).toEqual(''); | ||
}); | ||
|
||
test('prints url information with path and json output', async () => { | ||
const { stdout, stderr } = await execa('node', [ | ||
'index', | ||
'-j', | ||
'test5.html', | ||
]); | ||
expect(stdout).toMatchSnapshot(); | ||
expect(stderr).toEqual(''); | ||
}); | ||
|
||
test('prints url information with ignore arugment', async () => { | ||
const { stdout, stderr } = await execa('node', [ | ||
'index', | ||
'-i', | ||
'test5.html', | ||
'test4.txt', | ||
]); | ||
expect(stdout).toMatchSnapshot(); | ||
expect(stderr).toEqual(''); | ||
}); | ||
}); |