Skip to content

Commit c9b7670

Browse files
committed
chore: reformat tests file
1 parent 4043294 commit c9b7670

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import pathExists from 'path-exists';
77

88
const readfile = pify(fs.readFile);
99

10+
1011
test.before(() => {
1112
process.chdir('test');
1213
const params = {
@@ -23,16 +24,19 @@ test.before(() => {
2324
}
2425
});
2526

27+
2628
test('Show help on no input', async (t) => {
2729
const { stdout } = await execa('../index.js');
2830
t.truthy(stdout.includes(`$ backstop-crawl <url>`));
2931
});
3032

33+
3134
test('Failed on invalid URL', async (t) => {
3235
const { stderr } = await execa('../index.js', ['not a url'], { reject: false });
3336
t.truthy(stderr.replace(/\\|\n/, '') === `Error: "not a url" isn't a valid URL`);
3437
});
3538

39+
3640
test('Default usage', async (t) => {
3741
await execa('../index.js', ['http://0.0.0.0:8080']);
3842
const [file, expected] = await Promise.all([
@@ -43,6 +47,7 @@ test('Default usage', async (t) => {
4347
return t.deepEqual(file, expected);
4448
});
4549

50+
4651
test('Allow crawling subdomains', async (t) => {
4752
await execa('../index.js', ['https://badssl.com/', '--allow-subdomains', '--outfile=allow-subdomains.json']);
4853
const [file, expected] = await Promise.all([
@@ -53,6 +58,7 @@ test('Allow crawling subdomains', async (t) => {
5358
return t.deepEqual(file, expected);
5459
});
5560

61+
5662
test('Ignore SSL errors', async (t) => {
5763
await execa('../index.js', ['https://badssl.com/', '--ignore-ssl-errors', '--allow-subdomains', '--outfile=ignore-ssl-errors.json']);
5864
const [file, expected] = await Promise.all([
@@ -63,6 +69,7 @@ test('Ignore SSL errors', async (t) => {
6369
return t.deepEqual(file, expected);
6470
});
6571

72+
6673
test('Ignored robots.txt', async (t) => {
6774
await execa('../index.js', ['http://0.0.0.0:8080', '--ignore-robots', '--outfile=ignore-robots.json']);
6875
const [file, expected] = await Promise.all([
@@ -73,6 +80,7 @@ test('Ignored robots.txt', async (t) => {
7380
return t.deepEqual(file, expected);
7481
});
7582

83+
7684
test('Custom outfile', async (t) => {
7785
await execa('../index.js', ['http://0.0.0.0:8080', '--outfile=custom/out/file.json']);
7886
const [file, expected] = await Promise.all([
@@ -83,16 +91,19 @@ test('Custom outfile', async (t) => {
8391
return t.deepEqual(file, expected);
8492
});
8593

94+
8695
test('mkpath errors nicely', async (t) => {
8796
const { stderr } = await execa('../index.js', ['http://0.0.0.0:8080', '--outfile=fixtures/file-exists/backstop.json']);
8897
t.truthy(stderr.includes('fixtures/file-exists exists and is not a directory'));
8998
});
9099

100+
91101
test('jsonfile errors nicely', async (t) => {
92102
const { stderr } = await execa('../index.js', ['http://0.0.0.0:8080', '--outfile=fixtures/not-writeable']);
93103
t.truthy(stderr.includes(`✖ Error: EACCES: permission denied, open 'fixtures/not-writeable'`));
94104
});
95105

106+
96107
test('Debug flag produces crawl errors', async (t) => {
97108
const { stderr } = await execa('../index.js', ['https://expired.badssl.com/', '--debug', '--outfile=fixtures/debug.json']);
98109
t.truthy(stderr.includes(`✖ Error: certificate has expired`));

0 commit comments

Comments
 (0)