Skip to content

Commit b236c87

Browse files
authored
Merge pull request #615 from auth0/http-recording-test
Enabling HTTP request/response recordings for E2E tests
2 parents 23f1a89 + 1cdb5b8 commit b236c87

13 files changed

+8900
-68
lines changed

.circleci/config.yml

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# Javascript Node CircleCI 2.0 configuration file
2-
#
3-
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
4-
#
51
version: 2.1
2+
63
orbs:
74
codecov: codecov/codecov@3
5+
86
jobs:
97
e2e_test_as_node_module:
108
docker:
@@ -13,7 +11,8 @@ jobs:
1311
steps:
1412
- checkout
1513
- run: npm ci
16-
- run: npm run test:e2e:node-module
14+
- run: AUTH0_HTTP_RECORDINGS="lockdown" npm run test:e2e:node-module
15+
1716
e2e_test_as_cli:
1817
docker:
1918
- image: cimg/node:current
@@ -22,6 +21,7 @@ jobs:
2221
- checkout
2322
- run: npm ci
2423
- run: npm run test:e2e:cli
24+
2525
unit_test:
2626
parameters:
2727
v:
@@ -65,26 +65,27 @@ jobs:
6565
- run:
6666
name: Publish package
6767
command: npm publish
68+
6869
workflows:
6970
version: 2
71+
7072
e2e_test:
7173
jobs:
72-
- e2e_test_as_node_module:
73-
filters:
74-
branches:
75-
ignore: /pull\/[0-9]+/ # Ignore running on forked PRs
74+
- e2e_test_as_node_module
7675
- e2e_test_as_cli:
77-
filters:
78-
branches:
79-
ignore: /pull\/[0-9]+/ # Ignore running on forked PRs
76+
filters:
77+
branches:
78+
only: master
79+
8080
unit_test:
8181
jobs:
8282
- unit_test:
8383
name: test_lts
8484
v: "lts"
8585
- unit_test:
8686
name: test_current
87-
v: "18.0.0"
87+
v: "current"
88+
8889
test_and_deploy:
8990
jobs:
9091
- unit_test:

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ local/
44
node_modules/
55
lib/
66
/npm-debug.log
7-
config.json
7+
config*.json
88
.env
99
.idea
1010
.npmrc

package-lock.json

+86-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"lint:fix": "eslint --fix --ignore-path .eslintignore --ignore-pattern webpack . && kacl lint",
1111
"lint": "eslint --ignore-path .eslintignore --ignore-pattern webpack . && kacl lint",
1212
"format": "npx prettier --write .",
13-
"test": "ts-mocha -p tsconfig.json --recursive 'test/**/*.test*' --exclude test/e2e/* --timeout 5000",
14-
"test:e2e:node-module": "ts-node test/e2e/e2e-node-module.ts",
13+
"test": "ts-mocha -p tsconfig.json --recursive 'test/**/*.test*' --exclude 'test/e2e/*' --timeout 5000",
14+
"test:e2e:node-module": "ts-mocha -p tsconfig.json --recursive 'test/e2e/*.test*' --timeout 120000",
1515
"test:e2e:cli": "sh ./test/e2e/e2e-cli.sh",
1616
"test:coverage": "nyc npm run test; nyc report --reporter=lcov",
1717
"build": "rimraf ./lib && npx tsc",
@@ -34,6 +34,7 @@
3434
"dependencies": {
3535
"@types/lodash": "^4.14.181",
3636
"@types/nconf": "^0.10.2",
37+
"@types/nock": "^11.1.0",
3738
"@types/winston": "^2.4.4",
3839
"ajv": "^6.12.6",
3940
"auth0": "^2.42.0",
@@ -66,13 +67,15 @@
6667
"husky": "^7.0.4",
6768
"kacl": "^1.1.1",
6869
"mocha": "^9.2.2",
70+
"nock": "^13.2.9",
6971
"nyc": "^15.0.1",
7072
"prettier": "^2.6.2",
7173
"pretty-quick": "^3.1.3",
7274
"rimraf": "^3.0.2",
7375
"rmdir-sync": "^1.0.1",
7476
"ts-mocha": "^9.0.2",
75-
"typescript": "^4.7.4"
77+
"typescript": "^4.7.4",
78+
"zlib": "^1.0.5"
7679
},
7780
"overrides": {
7881
"istanbul-reports": "3.1.4"

test/e2e/e2e-cli.sh

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ echo "-------- Beginning deploy/import phase --------"
1818

1919
node lib/index.js import --env=false --input_file=$WORK_DIR --format=yaml -c=$CONFIG_FILE
2020

21+
rm $CONFIG_FILE

test/e2e/e2e-node-module.ts

-41
This file was deleted.

0 commit comments

Comments
 (0)