Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-tester

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-tester - npm Package Compare versions

Comparing version 3.3.0 to 4.0.0

71

dist/index.js

@@ -74,2 +74,3 @@ 'use strict';

var testNumber = 1;
if (fixtures) {

@@ -92,3 +93,3 @@ testFixtures(_extends({

return describe(describeBlockTitle, function () {
var promises = testAsArray.map(function (testConfig, index) {
var promises = testAsArray.map(function (testConfig) {
var testerWrapper = function () {

@@ -136,10 +137,3 @@ var _ref2 = _asyncToGenerator(function* () {

var _merge = (0, _lodash2.default)({}, testerConfig, toTestConfig({
testConfig,
index,
plugin,
pluginName,
pluginOptions,
filename
})),
var _merge = (0, _lodash2.default)({}, testerConfig, toTestConfig(testConfig)),
skip = _merge.skip,

@@ -218,2 +212,28 @@ only = _merge.only,

});
function toTestConfig(testConfig) {
if (typeof testConfig === 'string') {
testConfig = { code: testConfig };
}
var _testConfig = testConfig,
title = _testConfig.title,
fixture = _testConfig.fixture,
_testConfig$code = _testConfig.code,
code = _testConfig$code === undefined ? getCode(filename, fixture) : _testConfig$code,
_testConfig$fullTitle = _testConfig.fullTitle,
fullTitle = _testConfig$fullTitle === undefined ? title || `${testNumber++}. ${pluginName}` : _testConfig$fullTitle,
_testConfig$output = _testConfig.output,
output = _testConfig$output === undefined ? getCode(filename, testConfig.outputFixture) : _testConfig$output,
_testConfig$pluginOpt = _testConfig.pluginOptions,
testOptions = _testConfig$pluginOpt === undefined ? pluginOptions : _testConfig$pluginOpt;
return (0, _lodash2.default)({
babelOptions: { filename: getPath(filename, fixture) }
}, testConfig, {
babelOptions: { plugins: [[plugin, testOptions]] },
title: fullTitle,
code: (0, _stripIndent2.default)(code).trim(),
output: (0, _stripIndent2.default)(output).trim()
});
}
}

@@ -274,35 +294,2 @@

function toTestConfig(_ref4) {
var testConfig = _ref4.testConfig,
index = _ref4.index,
plugin = _ref4.plugin,
pluginName = _ref4.pluginName,
pluginOptions = _ref4.pluginOptions,
filename = _ref4.filename;
if (typeof testConfig === 'string') {
testConfig = { code: testConfig };
}
var _testConfig = testConfig,
title = _testConfig.title,
fixture = _testConfig.fixture,
_testConfig$code = _testConfig.code,
code = _testConfig$code === undefined ? getCode(filename, fixture) : _testConfig$code,
_testConfig$fullTitle = _testConfig.fullTitle,
fullTitle = _testConfig$fullTitle === undefined ? `${index + 1}. ${title || pluginName}` : _testConfig$fullTitle,
_testConfig$output = _testConfig.output,
output = _testConfig$output === undefined ? getCode(filename, testConfig.outputFixture) : _testConfig$output,
_testConfig$pluginOpt = _testConfig.pluginOptions,
testOptions = _testConfig$pluginOpt === undefined ? pluginOptions : _testConfig$pluginOpt;
return (0, _lodash2.default)({
babelOptions: { filename: getPath(filename, fixture) }
}, testConfig, {
babelOptions: { plugins: [[plugin, testOptions]] },
title: fullTitle,
code: (0, _stripIndent2.default)(code).trim(),
output: (0, _stripIndent2.default)(output).trim()
});
}
function getCode(filename, fixture) {

@@ -309,0 +296,0 @@ if (!fixture) {

{
"name": "babel-plugin-tester",
"version": "3.3.0",
"version": "4.0.0",
"description": "Utilities for testing babel plugins",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc