Don't merge test options. (#6157)
* Don't merge test options. Particularly, I don't want `lodash/merge` to merge my specific plugins with the general test plugins. It led to odd behavior where I could enable a loose transform in my specific test, just to have it overridden by the test fixture's general options. * Need options
This commit is contained in:
committed by
Henry Zhu
parent
40805894c5
commit
3e487f89ab
@@ -2,7 +2,7 @@ import cloneDeep from "lodash/cloneDeep";
|
||||
import trimEnd from "lodash/trimEnd";
|
||||
import resolve from "try-resolve";
|
||||
import clone from "lodash/clone";
|
||||
import merge from "lodash/merge";
|
||||
import extend from "lodash/extend";
|
||||
import semver from "semver";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
@@ -106,7 +106,7 @@ export default function get(entryLoc): Array<Suite> {
|
||||
const taskOpts = cloneDeep(suite.options);
|
||||
|
||||
const taskOptsLoc = resolve(taskDir + "/options");
|
||||
if (taskOptsLoc) merge(taskOpts, require(taskOptsLoc));
|
||||
if (taskOptsLoc) extend(taskOpts, require(taskOptsLoc));
|
||||
|
||||
const test = {
|
||||
optionsDir: taskOptsLoc ? path.dirname(taskOptsLoc) : null,
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["external-helpers"]
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"plugins": ["external-helpers"],
|
||||
"presets": ["stage-0", "es2015"]
|
||||
"plugins": ["external-helpers", ["transform-class-properties", {"loose": true}]],
|
||||
"presets": ["es2015"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"plugins": [["transform-es2015-block-scoping", { "throwIfClosureRequired": true }]],
|
||||
"throws": "Compiling let/const in this block would add a closure (throwIfClosureRequired)."
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"plugins": [["transform-es2015-block-scoping", { "throwIfClosureRequired": true }], "syntax-jsx", "transform-react-jsx", "transform-es2015-block-scoped-functions", "transform-es2015-arrow-functions"]
|
||||
"plugins": [["transform-es2015-block-scoping", { "throwIfClosureRequired": true }]]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "missing super() call in constructor"
|
||||
"throws": "missing super() call in constructor",
|
||||
"plugins": ["transform-es2015-classes"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "super() is only allowed in a derived constructor"
|
||||
"throws": "super() is only allowed in a derived constructor",
|
||||
"plugins": ["transform-es2015-classes"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "'super.*' is not allowed before super()"
|
||||
"throws": "'super.*' is not allowed before super()",
|
||||
"plugins": ["transform-es2015-classes"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "'super.*' is not allowed before super()"
|
||||
"throws": "'super.*' is not allowed before super()",
|
||||
"plugins": ["transform-es2015-classes"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "'super.*' is not allowed before super()"
|
||||
"throws": "'super.*' is not allowed before super()",
|
||||
"plugins": ["external-helpers", "transform-es2015-classes"]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "transform-es2015-classes", "transform-es2015-block-scoping"]
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "'this' is not allowed before super()"
|
||||
"throws": "'this' is not allowed before super()",
|
||||
"plugins": ["transform-es2015-classes"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "'this' is not allowed before super()"
|
||||
"throws": "'this' is not allowed before super()",
|
||||
"plugins": ["transform-es2015-classes"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "Illegal export \"__esModule\""
|
||||
"throws": "Illegal export \"__esModule\"",
|
||||
"plugins": ["transform-es2015-modules-commonjs"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "Illegal export \"__esModule\""
|
||||
"throws": "Illegal export \"__esModule\"",
|
||||
"plugins": ["transform-es2015-modules-commonjs"]
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["external-helpers"]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["external-helpers"]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["external-helpers"]
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"plugins": ["transform-es2015-object-super"]
|
||||
"plugins": ["transform-es2015-object-super", "transform-es2015-shorthand-properties"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"plugins": ["transform-es2015-parameters"]
|
||||
"plugins": ["transform-es2015-parameters", "transform-es2015-block-scoping"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "transform-es2015-parameters", "transform-async-to-generator"]
|
||||
"plugins": ["external-helpers", "transform-es2015-parameters", "transform-async-to-generator", "transform-es2015-arrow-functions"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"plugins": ["transform-new-target"],
|
||||
"throws": "new.target must be under a (non-arrow) function or a class."
|
||||
}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
{
|
||||
"parserOpts": {
|
||||
"allowReturnOutsideFunction": true
|
||||
},
|
||||
"plugins": [ "transform-es2015-destructuring" ]
|
||||
"plugins": [ "transform-es2015-destructuring", "transform-object-rest-spread" ]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user