-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from merkle-open/bugfix/functional-mistakes
Bugfix/functional mistakes
- Loading branch information
Showing
4 changed files
with
49 additions
and
3 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
46 changes: 46 additions & 0 deletions
46
packages/ts-config-webpack-plugin/test/WebpackConfigFiles.test.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,46 @@ | ||
const productionConfig = require('../config/production.config'); | ||
const developmentConfig = require('../config/development.config'); | ||
|
||
function filesRegexTests(filesRegex) { | ||
it('files regex matches .ts file ending', (done) => { | ||
expect(filesRegex.test('demo.ts')).toBe(true); | ||
done(); | ||
}); | ||
|
||
it('files regex matches .tsx file ending', (done) => { | ||
expect(filesRegex.test('demo.tsx')).toBe(true); | ||
done(); | ||
}); | ||
|
||
it('files regex matches .d.ts file ending', (done) => { | ||
expect(filesRegex.test('demo.d.ts')).toBe(true); | ||
done(); | ||
}); | ||
|
||
it('files regex doesn\'t match "asdfts" (escaping the first dot)', (done) => { | ||
expect(filesRegex.test('asdfts')).toBe(false); | ||
done(); | ||
}); | ||
|
||
it('files regex doesn\'t match "asdftsx" (escaping the first dot)', (done) => { | ||
expect(filesRegex.test('asdftsx')).toBe(false); | ||
done(); | ||
}); | ||
|
||
it('files regex doesn\'t match "demo.dxts" (escaping the second dot)', (done) => { | ||
expect(filesRegex.test('demo.dxts')).toBe(false); | ||
done(); | ||
}); | ||
} | ||
|
||
describe('TsConfigWebpackPlugin production config file', () => { | ||
const filesRegex = productionConfig({}).module.rules[0].test; | ||
|
||
filesRegexTests(filesRegex); | ||
}); | ||
|
||
describe('TsConfigWebpackPlugin development config file', () => { | ||
const filesRegex = developmentConfig({}).module.rules[0].test; | ||
|
||
filesRegexTests(filesRegex); | ||
}); |
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