From e376a4f1a5bfd2be863bd43c2db3340c30bf2dfe Mon Sep 17 00:00:00 2001 From: Devaradhan Murugesan Date: Tue, 5 Feb 2019 17:10:04 -0800 Subject: [PATCH] addressing PR comments --- .vscode/tasks.json | 16 ---------------- README.md | 5 ++--- src/tests/end-to-end/jest.config.js | 2 +- src/tests/jest.common.config.js | 1 - 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 5c415647e53..920d27a0d89 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -15,22 +15,6 @@ "panel": "dedicated" } }, - { - "label": "E2E test current file in VSCode", - "command": "node", - "args": [ - "${workspaceRoot}/node_modules/jest/bin/jest.js", - "--runInBand", - "--config=${workspaceRoot}/jest.e2e.config.js", - "${relativeFile}" - ], - "group": "test", - "type": "shell", - "presentation": { - "reveal": "always", - "panel": "dedicated" - } - }, { "label": "Begin Jest watch session", "command": "node", diff --git a/README.md b/README.md index 5a157b805ab..a86d8be49a8 100644 --- a/README.md +++ b/README.md @@ -86,11 +86,10 @@ We use [jest](https://github.com/facebook/jest) as our test framework and [puppe To run a task from the command palette, press **Ctrl + Shift + P**, select `Tasks: Run Task`, and select the task you want to run: - `npm: test` runs all unit tests -- `Test current file in VSCode` runs just the unit tests in the currently-opened file +- `Test current file in VSCode` runs just the tests in the currently-opened test file - `npm: test:e2e` runs all end-to-end tests -- `E2E test current file in VSCode` runs just the end-to-end tests in the currently-opened file -To debug inside VS Code, set a breakpoint and click the debug button or press **F5**. Note that there are 2 debug targets (one for unit tests and one for end-to-end tests); be sure to use the appropriate one for the test you are debugging. +To debug inside VS Code, set a breakpoint and click the debug button or press **F5**. To debug using an external tool, run the `Debug current test file outside VS Code` task. In Chrome, for example, navigate to `chrome://inspect` and click `Open dedicated DevTools for Node`. diff --git a/src/tests/end-to-end/jest.config.js b/src/tests/end-to-end/jest.config.js index 8af754c2474..06f00aacb08 100644 --- a/src/tests/end-to-end/jest.config.js +++ b/src/tests/end-to-end/jest.config.js @@ -17,7 +17,7 @@ module.exports = { 'js', ], rootDir: rootDir, - roots: ['/src/tests/end-to-end'], + roots: [currentDir], reporters: ['default', ['jest-junit', { outputDirectory: '.', outputName: '/test-results/e2e/junit-e2e.xml' }]], setupFilesAfterEnv: [`${currentDir}/setup/test-setup.ts`], globals: { diff --git a/src/tests/jest.common.config.js b/src/tests/jest.common.config.js index b585364ad6a..341c91ca9f7 100644 --- a/src/tests/jest.common.config.js +++ b/src/tests/jest.common.config.js @@ -2,7 +2,6 @@ // Licensed under the MIT License. module.exports = { clearMocks: true, - moduleFileExtensions: ['ts', 'tsx', 'js'], moduleNameMapper: { 'office-ui-fabric-react/lib/(.*)$': 'office-ui-fabric-react/lib-commonjs/$1', '@uifabric/utilities': '@uifabric/utilities/lib-commonjs',