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:
Justin Ridgewell
2017-08-28 15:36:03 -04:00
committed by Henry Zhu
parent 40805894c5
commit 3e487f89ab
23 changed files with 32 additions and 33 deletions

View File

@@ -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,

View File

@@ -1,3 +0,0 @@
{
"plugins": ["external-helpers"]
}

View File

@@ -1,4 +1,4 @@
{
"plugins": ["external-helpers"],
"presets": ["stage-0", "es2015"]
"plugins": ["external-helpers", ["transform-class-properties", {"loose": true}]],
"presets": ["es2015"]
}

View File

@@ -1,3 +1,4 @@
{
"plugins": [["transform-es2015-block-scoping", { "throwIfClosureRequired": true }]],
"throws": "Compiling let/const in this block would add a closure (throwIfClosureRequired)."
}

View File

@@ -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 }]]
}

View File

@@ -1,3 +1,4 @@
{
"throws": "missing super() call in constructor"
"throws": "missing super() call in constructor",
"plugins": ["transform-es2015-classes"]
}

View File

@@ -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"]
}

View File

@@ -1,3 +1,4 @@
{
"throws": "'super.*' is not allowed before super()"
"throws": "'super.*' is not allowed before super()",
"plugins": ["transform-es2015-classes"]
}

View File

@@ -1,3 +1,4 @@
{
"throws": "'super.*' is not allowed before super()"
"throws": "'super.*' is not allowed before super()",
"plugins": ["transform-es2015-classes"]
}

View File

@@ -1,3 +1,4 @@
{
"throws": "'super.*' is not allowed before super()"
"throws": "'super.*' is not allowed before super()",
"plugins": ["external-helpers", "transform-es2015-classes"]
}

View File

@@ -0,0 +1,3 @@
{
"plugins": ["external-helpers", "transform-es2015-classes", "transform-es2015-block-scoping"]
}

View File

@@ -1,3 +1,4 @@
{
"throws": "'this' is not allowed before super()"
"throws": "'this' is not allowed before super()",
"plugins": ["transform-es2015-classes"]
}

View File

@@ -1,3 +1,4 @@
{
"throws": "'this' is not allowed before super()"
"throws": "'this' is not allowed before super()",
"plugins": ["transform-es2015-classes"]
}

View File

@@ -1,3 +1,4 @@
{
"throws": "Illegal export \"__esModule\""
"throws": "Illegal export \"__esModule\"",
"plugins": ["transform-es2015-modules-commonjs"]
}

View File

@@ -1,3 +1,4 @@
{
"throws": "Illegal export \"__esModule\""
"throws": "Illegal export \"__esModule\"",
"plugins": ["transform-es2015-modules-commonjs"]
}

View File

@@ -1,3 +0,0 @@
{
"plugins": ["external-helpers"]
}

View File

@@ -1,3 +0,0 @@
{
"plugins": ["external-helpers"]
}

View File

@@ -1,3 +0,0 @@
{
"plugins": ["external-helpers"]
}

View File

@@ -1,3 +1,3 @@
{
"plugins": ["transform-es2015-object-super"]
"plugins": ["transform-es2015-object-super", "transform-es2015-shorthand-properties"]
}

View File

@@ -1,3 +1,3 @@
{
"plugins": ["transform-es2015-parameters"]
"plugins": ["transform-es2015-parameters", "transform-es2015-block-scoping"]
}

View File

@@ -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"]
}

View File

@@ -1,3 +1,4 @@
{
"plugins": ["transform-new-target"],
"throws": "new.target must be under a (non-arrow) function or a class."
}

View File

@@ -1,6 +1,3 @@
{
"parserOpts": {
"allowReturnOutsideFunction": true
},
"plugins": [ "transform-es2015-destructuring" ]
"plugins": [ "transform-es2015-destructuring", "transform-object-rest-spread" ]
}