-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Do not expect react-script to be in devDependencies (fix #526)
- Loading branch information
Showing
6 changed files
with
33 additions
and
53 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 |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import findUserWebpackConfig from '../findUserWebpackConfig'; | ||
|
||
const cwd = process.cwd(); | ||
afterEach(() => { | ||
process.chdir(cwd); | ||
}); | ||
afterEach(() => process.chdir(cwd)); | ||
|
||
it('should return path to Create React App Webpack config', () => { | ||
process.chdir('test/apps/cra'); | ||
const result = findUserWebpackConfig(); | ||
const result = findUserWebpackConfig(a => a); | ||
expect(result).toMatch(/^react-scripts\//); | ||
}); | ||
|
||
it('should return an absolute path to user Webpack config located in project root folder', () => { | ||
process.chdir('test/apps/basic'); | ||
|
||
const result = findUserWebpackConfig(); | ||
expect(result).toMatch(/^\//); | ||
expect(result).toMatch(/webpack.config.js$/); | ||
}); | ||
|
||
it('should return false if there is no webpack config', () => { | ||
process.chdir('test/apps/no-webpack'); | ||
|
||
const result = findUserWebpackConfig(); | ||
expect(result).toBeFalsy(); | ||
}); |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.