This repository has been archived by the owner on May 10, 2019. It is now read-only.
/
page-requests-test.js
executable file
·72 lines (62 loc) · 2.78 KB
/
page-requests-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env node
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
require('./lib/test_env.js');
const assert = require('assert'),
vows = require('vows'),
start_stop = require('./lib/start-stop.js'),
respondsWith = require('./lib/responds-with.js');
var suite = vows.describe('page requests');
process.env.PROXY_IDPS = JSON.stringify({
"yahoo.com": "example.domain"
});
// start up a pristine server
start_stop.addStartupBatches(suite);
// This set of tests check to make sure all of the expected pages are served
// up with the correct status codes.
suite.addBatch({
'GET /': respondsWith(200),
'GET /about': respondsWith(200),
'GET /en/tos': respondsWith(200),
'GET /en/privacy': respondsWith(200),
'GET /verify_email_address': respondsWith(200),
'GET /add_email_address': respondsWith(200),
'GET /confirm': respondsWith(200),
'GET /reset_password': respondsWith(200),
'GET /pk': respondsWith(200),
'GET /.well-known/browserid': respondsWith(200),
'GET /.well-known/browserid?domain=yahoo.com':
respondsWith(200),
'GET /unsupported_dialog': respondsWith(200),
'GET /unsupported_dialog_without_watch':
respondsWith(200),
'GET /cookies_disabled': respondsWith(200),
'GET /developers': respondsWith(302),
'GET /developers/': respondsWith(302),
'GET /signup': respondsWith(301),
'GET /signup/': respondsWith(301),
'GET /signin': respondsWith(301),
'GET /signin/': respondsWith(301),
'GET /forgot': respondsWith(301),
'GET /forgot/': respondsWith(301),
'GET /test': respondsWith(301),
'GET /test/': respondsWith(200),
'GET /include.js': respondsWith(200),
'GET /include.orig.js': respondsWith(200),
'GET /provisioning_api.js': respondsWith(200),
'GET /provisioning_api.orig.js':
respondsWith(200),
'GET /authentication_api.js': respondsWith(200),
'GET /authentication_api.orig.js':
respondsWith(200),
'GET /humans.txt': respondsWith(200),
'GET /build/code_version.js': respondsWith(200),
'GET /%e3h': respondsWith(404),
'GET /robots.txt': respondsWith(200)
});
// shut the server down and cleanup
start_stop.addShutdownBatches(suite);
// run or export the suite.
if (process.argv[1] === __filename) suite.run();
else suite.export(module);