Socket
Socket
Sign inDemoInstall

gherkin

Package Overview
Dependencies
Maintainers
3
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gherkin - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

dist/gherkin.js

7

lib/gherkin/token_scanner.js
var Token = require('./token');
var GherkinLine = require('./gherkin_line');
/**
* The scanner reads a gherkin doc (typically read from a .feature file) and creates a token for each line.
* The tokens are passed to the parser, which outputs an AST (Abstract Syntax Tree).
*
* If the scanner sees a `#` language header, it will reconfigure itself dynamically to look for
* Gherkin keywords for the associated language. The keywords are defined in gherkin-languages.json.
*/
module.exports = function TokenScanner(source) {

@@ -5,0 +12,0 @@ var lines = source.split(/\r?\n/);

8

package.json
{
"name": "gherkin",
"version": "3.1.1",
"version": "3.1.2",
"description": "Gherkin parser",

@@ -24,5 +24,5 @@ "main": "index.js",

"devDependencies": {
"bower": "^1.5.2",
"browserify": "^11.0.1",
"mocha": "^2.3.0",
"bower": "^1.5.3",
"browserify": "^11.2.0",
"mocha": "^2.3.3",
"mversion": "^1.10.1",

@@ -29,0 +29,0 @@ "uglify-js": "^2.4.24"

@@ -105,2 +105,21 @@ var assert = require('assert');

});
it("can change the default language", function () {
var parser = new Gherkin.Parser(new Gherkin.AstBuilder());
var matcher = new Gherkin.TokenMatcher("no");
var scanner = new Gherkin.TokenScanner("Egenskap: i18n support");
var ast = parser.parse(scanner, matcher);
assert.deepEqual(ast, {
type: 'Feature',
tags: [],
location: { line: 1, column: 1 },
language: 'no',
keyword: 'Egenskap',
name: 'i18n support',
description: undefined,
background: undefined,
scenarioDefinitions: [],
comments: []
});
});
});

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