This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Using different technique to ignore changes. #492
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
bbeae7b
Using different technique to ignore changes.
09a30fd
Merge branch 'master' into skyux-watch-ignore
8f61912
Fix tests
e62be07
Merge branch 'skyux-watch-ignore' of https://github.com/blackbaud/sky…
c2104bd
Merge branch 'master' into skyux-watch-ignore
2117aa4
Update config/karma/shared.karma.conf.js
00737ca
Fixed linting error.
8687844
Fixed resolved paths for Windows
Blackbaud-SteveBrush f35b34b
Make sure path.resolve is called.
0feeb61
Merge branch 'master' into skyux-watch-ignore
Blackbaud-SteveBrush File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,8 @@ function getConfig(config) { | |
const minimist = require('minimist'); | ||
const argv = minimist(process.argv.slice(2)); | ||
const path = require('path'); | ||
const srcPath = path.join(process.cwd(), 'src'); | ||
|
||
let testWebpackConfig = require('../webpack/test.webpack.config'); | ||
let remapIstanbul = require('remap-istanbul'); | ||
|
||
|
@@ -96,12 +98,17 @@ function getConfig(config) { | |
// trigger the `invalid` event, causing karma to constantly re-rerun | ||
// the tests. This is a by-product of using `require.context`. | ||
// https://github.com/webpack-contrib/karma-webpack/issues/253#issuecomment-335545430 | ||
// By using require.context in our @skyux/i18n library ALL project files are watched by default. | ||
// The function below ignores all files execpt the `src` directory. | ||
webpackMiddleware: { | ||
watchOptions: { | ||
ignored: [ | ||
'**/coverage/**', | ||
'**/.skypageslocales/**' | ||
] | ||
// Returning `true` means the file should be ignored. | ||
// Fat-Arrow functions do not work as chokidar will inspect this method. | ||
ignored: function (item) { | ||
const resolvedPath = path.resolve(item); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to resolve the path because Webpack will provide both of these values:
|
||
const ignore = (resolvedPath.indexOf(srcPath) === -1); | ||
return ignore; | ||
} | ||
} | ||
}, | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarification, this was incorrectly added in a previous PR due to a misconfigured unit test.