-
-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests(migration): typescript #613
Merged
Changes from 9 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ef09f3b
chore(test): add migrate test
sendilkumarn fcab1fe
chore(lint): revert change
sendilkumarn 2a86442
chore(test): moved to typescript migrate tests
ematipico 46355b8
tests(ts): moved module concatenation plugin to ts
ematipico 2c73046
tests(migrate): moved to typescript
ematipico aaa28a3
tests(webpack-scaffold): moved to typescript
hemal7735 1a80233
tests(migrate): clean js text fixtures
dhruvdutt 7e60efe
tests(migrate): update babel-loader test
dhruvdutt b4f114b
tests(migrate): update babel-loader snapshot
dhruvdutt dd238a8
tests(utils): move tests to TS (#688)
hemal7735 d6d27dc
tests(migrate): adds interface ILazyTransformObject
misterdev eb7a457
chore(commitlint): remove deprecated lang rule
misterdev 34aa982
chore(typings): fix tslint error
misterdev a98e867
tests(migration): refactor dirName in a variable
misterdev 31220a3
tests(migrate): refactor dirName in variable 2
misterdev 44da46b
tests(migrate): import path.resolve & add rootPath variable
misterdev ef8987d
tests(utils): adds type in forEach
misterdev a2e187f
tests(migrate): refactor resolve.test
misterdev 210ef72
Merge pull request #765 from misterdev/misterdev-ts-test-fixreview
evenstensberg 83a93e0
Merge branch 'master' into ts-test
sendilkumarn 55ecafa
chore(tests): enable ts in tests
sendilkumarn 67788ee
chore(tests): remove unwanted script
sendilkumarn 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import { join } from "path"; | ||
|
||
defineTest(join(__dirname, ".."), "bannerPlugin", "bannerPlugin-0"); | ||
defineTest(join(__dirname, ".."), "bannerPlugin", "bannerPlugin-1"); | ||
defineTest(join(__dirname, ".."), "bannerPlugin", "bannerPlugin-2"); | ||
const dirName: string = join(__dirname, ".."); | ||
|
||
defineTest(dirName, "bannerPlugin", "bannerPlugin-0"); | ||
defineTest(dirName, "bannerPlugin", "bannerPlugin-1"); | ||
defineTest(dirName, "bannerPlugin", "bannerPlugin-2"); |
24 changes: 13 additions & 11 deletions
24
packages/migrate/commonsChunkPlugin/__tests__/commonsChunkPlugin.test.ts
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,30 +1,32 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import { join } from "path"; | ||
|
||
defineTest(join(__dirname, ".."), "commonsChunkPlugin", "commonsChunkPlugin-0"); | ||
defineTest(join(__dirname, ".."), "commonsChunkPlugin", "commonsChunkPlugin-1"); | ||
defineTest(join(__dirname, ".."), "commonsChunkPlugin", "commonsChunkPlugin-2"); | ||
defineTest(join(__dirname, ".."), "commonsChunkPlugin", "commonsChunkPlugin-3"); | ||
defineTest(join(__dirname, ".."), "commonsChunkPlugin", "commonsChunkPlugin-4"); | ||
defineTest(join(__dirname, ".."), "commonsChunkPlugin", "commonsChunkPlugin-5"); | ||
const dirName: string = join(__dirname, ".."); | ||
|
||
defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-0"); | ||
defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-1"); | ||
defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-2"); | ||
defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-3"); | ||
defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-4"); | ||
defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-5"); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"commonsChunkPlugin", | ||
"commonsChunkPlugin-6a", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"commonsChunkPlugin", | ||
"commonsChunkPlugin-6b", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"commonsChunkPlugin", | ||
"commonsChunkPlugin-6c", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"commonsChunkPlugin", | ||
"commonsChunkPlugin-6d", | ||
); | ||
defineTest(join(__dirname, ".."), "commonsChunkPlugin", "commonsChunkPlugin-7"); | ||
defineTest(dirName, "commonsChunkPlugin", "commonsChunkPlugin-7"); |
3 changes: 2 additions & 1 deletion
3
packages/migrate/extractTextPlugin/__tests__/extractTextPlugin.test.ts
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,4 +1,5 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import { join } from "path"; | ||
|
||
defineTest(join(__dirname, ".."), "extractTextPlugin"); | ||
const dirName: string = join(__dirname, ".."); | ||
defineTest(dirName, "extractTextPlugin"); |
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
11 changes: 7 additions & 4 deletions
11
packages/migrate/loaderOptionsPlugin/__tests__/loaderOptionsPlugin.test.ts
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,22 +1,25 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import { join } from "path"; | ||
|
||
const dirName: string = join(__dirname, ".."); | ||
|
||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"loaderOptionsPlugin", | ||
"loaderOptionsPlugin-0", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"loaderOptionsPlugin", | ||
"loaderOptionsPlugin-1", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"loaderOptionsPlugin", | ||
"loaderOptionsPlugin-2", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"loaderOptionsPlugin", | ||
"loaderOptionsPlugin-3", | ||
); |
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,12 +1,14 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import { join } from "path"; | ||
|
||
defineTest(join(__dirname, ".."), "loaders", "loaders-0"); | ||
defineTest(join(__dirname, ".."), "loaders", "loaders-1"); | ||
defineTest(join(__dirname, ".."), "loaders", "loaders-2"); | ||
defineTest(join(__dirname, ".."), "loaders", "loaders-3"); | ||
defineTest(join(__dirname, ".."), "loaders", "loaders-4"); | ||
defineTest(join(__dirname, ".."), "loaders", "loaders-5"); | ||
defineTest(join(__dirname, ".."), "loaders", "loaders-6"); | ||
defineTest(join(__dirname, ".."), "loaders", "loaders-7"); | ||
defineTest(join(__dirname, ".."), "loaders", "loaders-8"); | ||
const dirName: string = join(__dirname, ".."); | ||
|
||
defineTest(dirName, "loaders", "loaders-0"); | ||
defineTest(dirName, "loaders", "loaders-1"); | ||
defineTest(dirName, "loaders", "loaders-2"); | ||
defineTest(dirName, "loaders", "loaders-3"); | ||
defineTest(dirName, "loaders", "loaders-4"); | ||
defineTest(dirName, "loaders", "loaders-5"); | ||
defineTest(dirName, "loaders", "loaders-6"); | ||
defineTest(dirName, "loaders", "loaders-7"); | ||
defineTest(dirName, "loaders", "loaders-8"); |
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
8 changes: 5 additions & 3 deletions
8
packages/migrate/moduleConcatenationPlugin/__tests__/moduleConcatenationPlugin.test.ts
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,18 +1,20 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import { join } from "path"; | ||
|
||
const dirName: string = join(__dirname, ".."); | ||
|
||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"moduleConcatenationPlugin", | ||
"moduleConcatenationPlugin-0", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"moduleConcatenationPlugin", | ||
"moduleConcatenationPlugin-1", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"moduleConcatenationPlugin", | ||
"moduleConcatenationPlugin-2", | ||
); |
9 changes: 6 additions & 3 deletions
9
packages/migrate/namedModulesPlugin/__tests__/namedModulesPlugin.test.ts
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,5 +1,8 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import { join } from "path"; | ||
defineTest(join(__dirname, ".."), "namedModulesPlugin", "namedModulesPlugin-0"); | ||
defineTest(join(__dirname, ".."), "namedModulesPlugin", "namedModulesPlugin-1"); | ||
defineTest(join(__dirname, ".."), "namedModulesPlugin", "namedModulesPlugin-2"); | ||
|
||
const dirName: string = join(__dirname, ".."); | ||
|
||
defineTest(dirName, "namedModulesPlugin", "namedModulesPlugin-0"); | ||
defineTest(dirName, "namedModulesPlugin", "namedModulesPlugin-1"); | ||
defineTest(dirName, "namedModulesPlugin", "namedModulesPlugin-2"); |
9 changes: 6 additions & 3 deletions
9
packages/migrate/noEmitOnErrorsPlugin/__tests__/noEmitOnErrorsPlugin.test.ts
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,17 +1,20 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import { join } from "path"; | ||
|
||
const dirName: string = join(__dirname, ".."); | ||
|
||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"noEmitOnErrorsPlugin", | ||
"noEmitOnErrorsPlugin-0", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"noEmitOnErrorsPlugin", | ||
"noEmitOnErrorsPlugin-1", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"noEmitOnErrorsPlugin", | ||
"noEmitOnErrorsPlugin-2", | ||
); |
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,6 +1,8 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import { join } from "path"; | ||
|
||
defineTest(join(__dirname, ".."), "outputPath", "outputPath-0"); | ||
defineTest(join(__dirname, ".."), "outputPath", "outputPath-1"); | ||
defineTest(join(__dirname, ".."), "outputPath", "outputPath-2"); | ||
const dirName: string = join(__dirname, ".."); | ||
|
||
defineTest(dirName, "outputPath", "outputPath-0"); | ||
defineTest(dirName, "outputPath", "outputPath-1"); | ||
defineTest(dirName, "outputPath", "outputPath-2"); |
12 changes: 7 additions & 5 deletions
12
packages/migrate/removeDeprecatedPlugins/__tests__/removeDeprecatedPlugins.test.ts
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,28 +1,30 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import { join } from "path"; | ||
|
||
const dirName: string = join(__dirname, ".."); | ||
|
||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"removeDeprecatedPlugins", | ||
"removeDeprecatedPlugins-0", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"removeDeprecatedPlugins", | ||
"removeDeprecatedPlugins-1", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"removeDeprecatedPlugins", | ||
"removeDeprecatedPlugins-2", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"removeDeprecatedPlugins", | ||
"removeDeprecatedPlugins-3", | ||
); | ||
defineTest( | ||
join(__dirname, ".."), | ||
dirName, | ||
"removeDeprecatedPlugins", | ||
"removeDeprecatedPlugins-4", | ||
); |
13 changes: 8 additions & 5 deletions
13
packages/migrate/removeJsonLoader/__tests__/removeJsonLoader.test.ts
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,22 +1,25 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import * as path from "path"; | ||
import { join } from "path"; | ||
|
||
const dirName: string = join(__dirname, ".."); | ||
|
||
defineTest( | ||
path.join(__dirname, ".."), | ||
dirName, | ||
"removeJsonLoader", | ||
"removeJsonLoader-0", | ||
); | ||
defineTest( | ||
path.join(__dirname, ".."), | ||
dirName, | ||
"removeJsonLoader", | ||
"removeJsonLoader-1", | ||
); | ||
defineTest( | ||
path.join(__dirname, ".."), | ||
dirName, | ||
"removeJsonLoader", | ||
"removeJsonLoader-2", | ||
); | ||
defineTest( | ||
path.join(__dirname, ".."), | ||
dirName, | ||
"removeJsonLoader", | ||
"removeJsonLoader-3", | ||
); |
11 changes: 6 additions & 5 deletions
11
packages/migrate/resolve/__tests__/__snapshots__/resolve.test.ts.snap
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
11 changes: 6 additions & 5 deletions
11
packages/migrate/resolve/__tests__/__testfixtures__/resolve.input.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 |
---|---|---|
@@ -1,24 +1,25 @@ | ||
const path = require("patch"); | ||
const path = require("path"); | ||
const rootPath = path.resolve("/src"); | ||
module.exports = [ | ||
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.
|
||
{ | ||
resolve: { | ||
root: path.resolve("/src") | ||
root: rootPath | ||
} | ||
}, | ||
{ | ||
resolve: { | ||
root: [path.resolve("/src")] | ||
root: [rootPath] | ||
} | ||
}, | ||
{ | ||
resolve: { | ||
root: [path.resolve("/src"), "node_modules"] | ||
root: [rootPath, "node_modules"] | ||
} | ||
}, | ||
{ | ||
resolve: { | ||
modules: ["node_modules"], | ||
root: path.resolve("/src") | ||
root: rootPath | ||
} | ||
} | ||
]; |
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,4 +1,5 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import * as path from "path"; | ||
import { join } from "path"; | ||
|
||
defineTest(path.join(__dirname, ".."), "resolve"); | ||
const dirName: string = join(__dirname, ".."); | ||
defineTest(dirName, "resolve"); |
13 changes: 8 additions & 5 deletions
13
packages/migrate/uglifyJsPlugin/__tests__/uglifyJsPlugin.test.ts
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,7 +1,10 @@ | ||
import defineTest from "@webpack-cli/utils/defineTest"; | ||
import { join } from "path"; | ||
defineTest(join(__dirname, ".."), "uglifyJsPlugin", "uglifyJsPlugin-0"); | ||
defineTest(join(__dirname, ".."), "uglifyJsPlugin", "uglifyJsPlugin-1"); | ||
defineTest(join(__dirname, ".."), "uglifyJsPlugin", "uglifyJsPlugin-2"); | ||
defineTest(join(__dirname, ".."), "uglifyJsPlugin", "uglifyJsPlugin-3"); | ||
defineTest(join(__dirname, ".."), "uglifyJsPlugin", "uglifyJsPlugin-4"); | ||
|
||
const dirName: string = join(__dirname, ".."); | ||
|
||
defineTest(dirName, "uglifyJsPlugin", "uglifyJsPlugin-0"); | ||
defineTest(dirName, "uglifyJsPlugin", "uglifyJsPlugin-1"); | ||
defineTest(dirName, "uglifyJsPlugin", "uglifyJsPlugin-2"); | ||
defineTest(dirName, "uglifyJsPlugin", "uglifyJsPlugin-3"); | ||
defineTest(dirName, "uglifyJsPlugin", "uglifyJsPlugin-4"); |
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.
in variable