Skip to content

Commit

Permalink
[Unified Recorder] Add sample unified recorder tests to template (#18817
Browse files Browse the repository at this point in the history
)

Resolves #18227.
  • Loading branch information
timovv authored Jan 10, 2022
1 parent 24798c4 commit 3d3914b
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 245 deletions.
3 changes: 3 additions & 0 deletions sdk/template/template/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

// https://github.com/karma-runner/karma-chrome-launcher
process.env.CHROME_BIN = require("puppeteer").executablePath();
process.env.RECORDINGS_RELATIVE_PATH =
require("@azure-tools/test-recorder-new").relativeRecordingsPath();
require("dotenv").config();
const {
jsonRecordingFilterFunction,
Expand Down Expand Up @@ -61,6 +63,7 @@ module.exports = function (config) {
"AZURE_CLIENT_ID",
"AZURE_CLIENT_SECRET",
"AZURE_TENANT_ID",
"RECORDINGS_RELATIVE_PATH",
],

// test results reporter to use
Expand Down
16 changes: 9 additions & 7 deletions sdk/template/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"generate:client": "autorest --typescript ./swagger/README.md",
"integration-test:browser": "karma start --single-run",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"",
"integration-test:browser": "dev-tool run test:browser",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/**/*.spec.ts'",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts",
"pack": "npm pack 2>&1",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tsc -p . && npm run unit-test:node && npm run integration-test:node",
"test:browser": "npm run clean && npm run build:test && npm run integration-test:browser",
"test:node": "npm run clean && tsc -p . && npm run integration-test:node",
"test": "npm run clean && tsc -p . && npm run unit-test:node && rollup -c 2>&1 && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "karma start --single-run",
"unit-test:node": "mocha -r esm -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace --exclude \"test/**/browser/*.spec.ts\" \"test/**/*.spec.ts\"",
"unit-test:browser": "npm run integration-test:browser",
"unit-test:node": "npm run integration-test:node",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"files": [
Expand Down Expand Up @@ -121,7 +121,9 @@
"rollup": "^1.16.3",
"source-map-support": "^0.5.9",
"typescript": "~4.2.0",
"util": "^0.12.1"
"util": "^0.12.1",
"@azure-tools/test-recorder-new": "~1.0.0",
"@azure-tools/test-credential": "~1.0.0"
},
"//sampleConfiguration": {
"skipFolder": false,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3d3914b

Please sign in to comment.