gherkin
Advanced tools
Comparing version 4.1.3 to 5.0.1
@@ -8,3 +8,3 @@ var Parser = require('./parser') | ||
function generateEvents(data, uri, types) { | ||
function generateEvents(data, uri, types, language) { | ||
types = Object.assign({ | ||
@@ -26,3 +26,3 @@ 'source': true, | ||
encoding: 'utf-8', | ||
type: 'text/vnd.cucumber.gherkin+plain' | ||
type: 'text/x.cucumber.gherkin+plain' | ||
} | ||
@@ -35,3 +35,3 @@ }) | ||
var gherkinDocument = parser.parse(data) | ||
var gherkinDocument = parser.parse(data, language) | ||
@@ -71,3 +71,3 @@ if (types['gherkin-document']) { | ||
encoding: "utf-8", | ||
type: "text/vnd.cucumber.stacktrace+plain" | ||
type: "text/x.cucumber.stacktrace+plain" | ||
} | ||
@@ -74,0 +74,0 @@ }) |
@@ -577,3 +577,4 @@ { | ||
"scenarioOutline": [ | ||
"Περιγραφή Σεναρίου" | ||
"Περιγραφή Σεναρίου", | ||
"Περίγραμμα Σεναρίου" | ||
], | ||
@@ -2350,2 +2351,3 @@ "then": [ | ||
"Dat fiind ", | ||
"Dată fiind", | ||
"Dati fiind ", | ||
@@ -2352,0 +2354,0 @@ "Dați fiind ", |
@@ -27,6 +27,4 @@ var countSymbols = require('../count_symbols'); | ||
function compileScenario(featureTags, backgroundSteps, scenario, language, pickles) { | ||
if (scenario.steps.length == 0) return; | ||
var steps = scenario.steps.length == 0 ? [] : [].concat(backgroundSteps); | ||
var steps = [].concat(backgroundSteps); | ||
var tags = [].concat(featureTags).concat(scenario.tags); | ||
@@ -49,4 +47,2 @@ | ||
function compileScenarioOutline(featureTags, backgroundSteps, scenarioOutline, language, pickles) { | ||
if (scenarioOutline.steps.length == 0) return; | ||
scenarioOutline.examples.filter(function(e) { return e.tableHeader != undefined; }).forEach(function (examples) { | ||
@@ -56,3 +52,3 @@ var variableCells = examples.tableHeader.cells; | ||
var valueCells = values.cells; | ||
var steps = [].concat(backgroundSteps); | ||
var steps = scenarioOutline.steps.length == 0 ? [] : [].concat(backgroundSteps); | ||
var tags = [].concat(featureTags).concat(scenarioOutline.tags).concat(examples.tags); | ||
@@ -59,0 +55,0 @@ |
@@ -14,6 +14,7 @@ const Stream = require('stream') | ||
*/ | ||
constructor(uri, types) { | ||
constructor(uri, types, language) { | ||
super({ objectMode: true }) | ||
this._uri = uri | ||
this._types = types | ||
this._language = language | ||
this._gherkin = "" | ||
@@ -28,3 +29,3 @@ } | ||
_flush(callback) { | ||
const events = generateEvents(this._gherkin, this._uri, this._types) | ||
const events = generateEvents(this._gherkin, this._uri, this._types, this._language) | ||
for (const event of events) { | ||
@@ -37,2 +38,2 @@ this.push(event) | ||
module.exports = EventStream | ||
module.exports = EventStream |
{ | ||
"name": "gherkin", | ||
"version": "4.1.3", | ||
"version": "5.0.1", | ||
"description": "Gherkin parser", | ||
@@ -10,3 +10,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "make && mocha" | ||
}, | ||
@@ -13,0 +13,0 @@ "repository": { |
@@ -21,2 +21,18 @@ const assert = require('assert') | ||
}) | ||
}) | ||
it("accepts a language parameter", (callback) => { | ||
const events = [] | ||
const eventStream = new EventStream('test_fr.feature', { | ||
'source': true, | ||
'gherkin-document': true, | ||
'pickle': true | ||
}, 'fr') | ||
eventStream.on('data', data => events.push(data)) | ||
eventStream.on('end', () => { | ||
assert.equal(events.length, 3) | ||
assert.deepEqual(events.map(e => e.uri), ['test_fr.feature', 'test_fr.feature', 'test_fr.feature']) | ||
callback() | ||
}) | ||
fs.createReadStream(__dirname + '/test_fr.feature', { encoding: 'utf-8' }).pipe(eventStream) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1483802
195
13272