Skip to content

Make recorder test selection compatible with mocha@6#4859

Merged
mikeharder merged 2 commits intoAzure:masterfrom
mikeharder:recorder-test-context
Aug 22, 2019
Merged

Make recorder test selection compatible with mocha@6#4859
mikeharder merged 2 commits intoAzure:masterfrom
mikeharder:recorder-test-context

Conversation

@mikeharder
Copy link
Member

@mikeharder mikeharder commented Aug 22, 2019

  • The behavior of testContext changed slightly between mocha v5 and v6.
    • In mocha v5, testContext.currentTest was null for "before all" hooks, so it could be used to disambiguate between "before all" and "before each" hooks.
    • In mocha v6, testContext.currentTest points to the individual test that will be run next, for both "before all" and "before each" hooks.
  • The new test selection logic is compatible with both mocha v5 and v6

@mikeharder mikeharder merged commit d7d84a7 into Azure:master Aug 22, 2019
@mikeharder mikeharder deleted the recorder-test-context branch August 22, 2019 19:17
HarshaNalluru added a commit to HarshaNalluru/azure-sdk-for-js that referenced this pull request Aug 22, 2019
HarshaNalluru added a commit that referenced this pull request Aug 23, 2019
* update rush.json with the new package

* porting the latest Guidelines from feature/storage

* porting the latest guidelines from feature/storage branch

* add readme - test utils - Record and Playback

* Add disclaimer - mocha and karma

* removed the dependency of core-http

* remove storage utils dependency

* add package.json

* cherry picked commit from feature/storage branch

* pnpm-lock updated

* simplify recorder.ts with utils.ts

* removed dotenv

* Improved delay module

* remove delay from utils.ts file

* keep only the final recorder module in recorder.ts

* separate customConsoleLog.ts

* decouple base recorder from recorder

* add some return types

* update skip list

* ignore readme checks

* add karma.conf.js file in the template

* add karma dependencies

* update rollup for consistency

* update scripts - package.json

* update node test suite

* update unit-test scripts

* seperate out node tests and browser tests

* 👊 is not allowed in headless chrome browser, So, updated to ❤

* sample browser test

* comment out polyfill

* entry points - add comments

* skip unit tests

* add tsconfig

* add License.txt

* add index.ts

* updates types, add rollup, tsconfig.json

* types -> typings

* cleaning rollup

* cjs plugin

* expose setReplaceableVariables for keyvault

* import nock

* update pnpm-lock

* mark nock as external for browser

* expose setENV on load

* updates to file path and setEnviromentOnLoad - node tests -record and playback works

* T -> t in the rollup browser config for consistency

* update browser field in package.json

* update newDate and add some types

* added interface for TestInfo

* isRecording, isPlayingBack - boolean functions

* env -> runtime rename

* Update Guidelines for the new common recorder

* Updating browser recorder.stop() method to satisfy KeyVault

* commit pnpm-lock

* use path.resolve to cater both linux and windows

* update PNPM lock

* commit pnpm lock file

* fix browser issue with recorder package

* Updating GuideLines with karma setup

* final version of karma settings

* if (env.ACCOUNT_NAME) replace acc name only if present

* update fs-extra module

* add a no-op placeholder test

* rollup entry point fix

* update typings path

* add TODOs

* explanation for require("path") instead of import

* moved delay() to utils

* delay moved to utils

* isRecording -> isRecordMode, isPlayingBack -> isPlaybackMode

* runtime: "node" | "browsers" - union type

* testHierarchy -> testSuiteTitle

* runtime -> platform

* importNock constant to importNockStatement

* update the escapeRegExp function

* Elaborating beforeeach, aftereach details and minor improvements - Guidelines

* regenerate pnpm-lock file

* Aborter -> Some Random Test Suite

* Addressed Jonathan's comments - removed storage specific code and other minor comments

* More info on readyState

* Copying Mike's fix from #4859 for mocha@6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant