-
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ignore package.json on windows (#735)
In this commit I added an E2E test for the case described in #674, fixed the slash bug, and moved package.json ignore to a different place (because ignoring watch on the package.json could interfere with other plugins/loaders) Closes: #674
- Loading branch information
1 parent
a2826a8
commit 4787553
Showing
6 changed files
with
86 additions
and
7 deletions.
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare function sayHello(who: string): string; |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.sayHello = void 0; | ||
function sayHello(who) { | ||
return 'Hello ' + who + '!'; | ||
} | ||
exports.sayHello = sayHello; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "typescript-nested-project", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"main": "./index.js", | ||
"types": "./index.d.ts", | ||
"files": [ | ||
"./index.js" | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import path from 'path'; | ||
|
||
import { createProcessDriver } from 'karton'; | ||
|
||
import { createWebpackDevServerDriver } from './driver/webpack-dev-server-driver'; | ||
|
||
describe('Webpack Inclusive Watcher', () => { | ||
it.each([{ async: false }, { async: true }])( | ||
'ignores package.json change for %p', | ||
async ({ async }) => { | ||
await sandbox.load(path.join(__dirname, 'fixtures/typescript-basic')); | ||
await sandbox.load(path.join(__dirname, 'fixtures/typescript-package')); | ||
await sandbox.install('yarn', { typescript: '4.6.3' }); | ||
await sandbox.patch('webpack.config.js', 'async: false,', `async: ${JSON.stringify(async)},`); | ||
|
||
// add import to typescript-nested-project project | ||
await sandbox.patch( | ||
'src/index.ts', | ||
"import { getUserName } from './model/User';", | ||
[ | ||
"import { getUserName } from './model/User';", | ||
'import { sayHello } from "../package";', | ||
'', | ||
"sayHello('World');", | ||
].join('\n') | ||
); | ||
|
||
// start webpack dev server | ||
const process = sandbox.spawn('yarn webpack serve --mode=development'); | ||
const baseDriver = createProcessDriver(process); | ||
const webpackDriver = createWebpackDevServerDriver(process, async); | ||
|
||
await webpackDriver.waitForNoErrors(); | ||
|
||
// update nested package.json file | ||
await sandbox.patch('package/package.json', '"1.0.0"', '"1.0.1"'); | ||
|
||
// wait for 5 seconds and fail if there is Debug Failure. in the console output | ||
await expect(() => | ||
baseDriver.waitForStderrIncludes('Error: Debug Failure.', 5000) | ||
).rejects.toEqual( | ||
new Error('Exceeded time on waiting for "Error: Debug Failure." to appear in the stderr.') | ||
); | ||
|
||
await webpackDriver.waitForNoErrors(); | ||
} | ||
); | ||
}); |