New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cucumber-expressions

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cucumber-expressions - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

.babelrc

4

examples.txt

@@ -16,1 +16,5 @@ I have {n} cuke(s) in my {bodypart} now

[1,"belly"]
---
/^Something( with an optional argument)?$/
Something
[null]

22

package.json
{
"name": "cucumber-expressions",
"version": "1.0.1",
"version": "1.0.2",
"description": "Cucumber Expressions - a simpler alternative to Regular Expressions",
"main": "dist/index.js",
"scripts": {
"test": "mocha --recursive",
"coverage": "ISTANBUL=true istanbul cover _mocha -- --recursive",
"postcoverage": "istanbul check-coverage --statements 100 --branches 100"
"test": "npm run eslint && npm run coverage",
"eslint": "eslint src test",
"build": "babel src --out-dir dist",
"prepublish": "npm run build",
"postinstall": "node scripts/postinstall.js",
"mocha": "mocha",
"coverage": "ISTANBUL=true istanbul cover _mocha"
},

@@ -27,6 +32,9 @@ "repository": {

"devDependencies": {
"eslint": "^2.13.1",
"istanbul": "^0.4.0",
"mocha": "^2.3.3"
"babel-cli": "^6.18.0",
"babel-preset-es2015": "^6.18.0",
"eslint": "^3.9.1",
"eslint-config-eslint": "^3.0.0",
"istanbul": "^1.1.0-alpha.1",
"mocha": "^3.1.2"
}
}

@@ -1,5 +0,6 @@

const assert = require('assert')
const CucumberExpressionGenerator = require('../lib/cucumber_expression_generator')
const Transform = require('../lib/transform')
const TransformLookup = require('../lib/transform_lookup')
/* eslint-env mocha */
import assert from 'assert'
import CucumberExpressionGenerator from '../src/cucumber_expression_generator'
import Transform from '../src/transform'
import TransformLookup from '../src/transform_lookup'

@@ -33,2 +34,3 @@ class Currency {

assert.equal(generatedExpression.source, "I have {arg1:int} cucumbers and {arg2:float} tomato")
assert.equal(generatedExpression.argumentNames[0], 'arg1')
assert.equal(generatedExpression.transforms[1].typeName, 'float')

@@ -35,0 +37,0 @@ /// [generate-expression]

@@ -1,4 +0,5 @@

const assert = require('assert')
const CucumberExpression = require('../lib/cucumber_expression')
const TransformLookup = require('../lib/transform_lookup')
/* eslint-env mocha */
import assert from 'assert'
import CucumberExpression from '../src/cucumber_expression'
import TransformLookup from '../src/transform_lookup'

@@ -5,0 +6,0 @@ describe(CucumberExpression.name, () => {

@@ -1,4 +0,4 @@

const assert = require('assert')
const CucumberExpression = require('../lib/cucumber_expression')
const TransformLookup = require('../lib/transform_lookup')
/* eslint-env mocha */
import assert from 'assert'
import { CucumberExpression, TransformLookup } from '../src/index'

@@ -5,0 +5,0 @@ describe(CucumberExpression.name, () => {

@@ -1,6 +0,7 @@

const assert = require('assert')
const CucumberExpression = require('../lib/cucumber_expression')
const RegularExpression = require('../lib/regular_expression')
const TransformLookup = require('../lib/transform_lookup')
const Transform = require('../lib/transform')
/* eslint-env mocha */
import assert from 'assert'
import CucumberExpression from '../src/cucumber_expression'
import RegularExpression from '../src/regular_expression'
import TransformLookup from '../src/transform_lookup'
import Transform from '../src/transform'

@@ -31,3 +32,3 @@ class Color {

describe(CucumberExpression.name, () => {
it("converts arguments with expression type", () => {
it("transforms arguments with expression type", () => {
const expression = new CucumberExpression("I have a {color:color} ball", [], transformLookup)

@@ -38,3 +39,3 @@ const transformedArgumentValue = expression.match("I have a red ball")[0].transformedValue

it("converts arguments with explicit type", () => {
it("transforms arguments with explicit type", () => {
const expression = new CucumberExpression("I have a {color} ball", [Color], transformLookup)

@@ -45,3 +46,3 @@ const transformedArgumentValue = expression.match("I have a red ball")[0].transformedValue

it("converts arguments using argument name as type", () => {
it("transforms arguments using argument name as type", () => {
const expression = new CucumberExpression("I have a {color} ball", [], transformLookup)

@@ -52,3 +53,3 @@ const transformedArgumentValue = expression.match("I have a red ball")[0].transformedValue

it("converts arguments with explicit type using constructor directly", () => {
it("transforms arguments with explicit type using constructor directly", () => {
const expression = new CucumberExpression("I have a {color} ball", [Color], new TransformLookup())

@@ -60,3 +61,3 @@ const transformedArgumentValue = expression.match("I have a red ball")[0].transformedValue

// JavaScript-specific (specifying type as string)
it("converts arguments with explicit type name", () => {
it("transforms arguments with explicit type name", () => {
const expression = new CucumberExpression("I have a {color} ball", ['color'], transformLookup)

@@ -69,3 +70,3 @@ const transformedArgumentValue = expression.match("I have a red ball")[0].transformedValue

describe(RegularExpression.name, () => {
it("converts arguments with explicit type", () => {
it("transforms arguments with explicit type", () => {
const expression = new RegularExpression(/I have a (red|blue|yellow) ball/, [Color], transformLookup)

@@ -76,3 +77,3 @@ const transformedArgumentValue = expression.match("I have a red ball")[0].transformedValue

it("converts arguments without explicit type", () => {
it("transforms arguments without explicit type", () => {
const expression = new RegularExpression(/I have a (red|blue|yellow) ball/, [], transformLookup)

@@ -83,3 +84,3 @@ const transformedArgumentValue = expression.match("I have a red ball")[0].transformedValue

it("converts arguments with explicit type using constructor directly", () => {
it("transforms arguments with explicit type using constructor directly", () => {
const expression = new RegularExpression(/I have a (red|blue|yellow) ball/, [Color], new TransformLookup())

@@ -91,3 +92,3 @@ const transformedArgumentValue = expression.match("I have a red ball")[0].transformedValue

// JavaScript-specific (specifying type as string)
it("converts arguments with explicit type name", () => {
it("transforms arguments with explicit type name", () => {
const expression = new RegularExpression(/I have a (red|blue|yellow) ball/, ['color'], transformLookup)

@@ -94,0 +95,0 @@ const transformedArgumentValue = expression.match("I have a red ball")[0].transformedValue

@@ -1,6 +0,7 @@

const fs = require('fs')
const assert = require('assert')
const CucumberExpression = require('../lib/cucumber_expression')
const RegularExpression = require('../lib/regular_expression')
const TransformLookup = require('../lib/transform_lookup')
/* eslint-env mocha */
import fs from 'fs'
import assert from 'assert'
import CucumberExpression from '../src/cucumber_expression'
import RegularExpression from '../src/regular_expression'
import TransformLookup from '../src/transform_lookup'

@@ -13,5 +14,5 @@ describe('examples.txt', () => {

new CucumberExpression(expression_text, [], new TransformLookup())
const arguments = expression.match(text)
if (!arguments) return null
return arguments.map(arg => arg.transformedValue)
const args = expression.match(text)
if (!args) return null
return args.map(arg => arg.transformedValue)
}

@@ -18,0 +19,0 @@

@@ -1,4 +0,5 @@

const assert = require('assert')
const RegularExpression = require('../lib/regular_expression')
const TransformLookup = require('../lib/transform_lookup')
/* eslint-env mocha */
import assert from 'assert'
import RegularExpression from '../src/regular_expression'
import TransformLookup from '../src/transform_lookup'

@@ -75,5 +76,5 @@ describe(RegularExpression.name, () => {

const regularExpression = new RegularExpression(regexp, types || [], transformLookup)
const arguments = regularExpression.match(text)
if (!arguments) return null
return arguments.map(arg => arg.transformedValue)
const args = regularExpression.match(text)
if (!args) return null
return args.map(arg => arg.transformedValue)
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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