Skip to content

Commit

Permalink
clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielberndt committed Aug 6, 2018
1 parent 0d90bcf commit 09bf2ac
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import pluginTester from "babel-plugin-tester";
import glamorousToEmotion from "../index.js";
import path from "path";

pluginTester({
const sharedOptions = {
plugin: glamorousToEmotion,
babelOptions: {
// taken from https://github.com/square/babel-codemod/blob/00ae5984e1b2ca2fac923011ce16157a29b12b39/src/AllSyntaxPlugin.ts
Expand All @@ -28,35 +28,15 @@ pluginTester({
babelrc: false,
compact: false,
},
};

pluginTester({
...sharedOptions,
fixtures: path.join(__dirname, "__fixtures__", "without-babel-plugin"),
});

pluginTester({
plugin: glamorousToEmotion,
babelOptions: {
// taken from https://github.com/square/babel-codemod/blob/00ae5984e1b2ca2fac923011ce16157a29b12b39/src/AllSyntaxPlugin.ts
parserOpts: {
sourceType: "module",
allowImportExportEverywhere: true,
allowReturnOutsideFunction: true,
allowSuperOutsideMethod: true,
ranges: false,
plugins: [
"jsx",
"asyncGenerators",
"classProperties",
"doExpressions",
"exportExtensions",
"functionBind",
"functionSent",
"objectRestSpread",
"dynamicImport",
"decorators",
],
},
babelrc: false,
compact: false,
},
...sharedOptions,
fixtures: path.join(__dirname, "__fixtures__", "with-babel-plugin"),
pluginOptions: {
withBabelPlugin: true,
Expand Down

0 comments on commit 09bf2ac

Please sign in to comment.