Comments (10)
I can confirm this issue.
I tried the workaround, which works... though I'd prefer a stronger regex (since I'm logging objects and array).
I guess this is the part we want to capture:
[
{
"elements": [
{
"id": ".......",
.....
from grunt-cucumberjs.
Hi SirLenz0rlot, couldn't agree more about stronger regex.
Try this, seems to work for both:
/\[\s*{\s*\"|\[\"/g
All I added was a pipe in the middle there, searching for either object start or array start. It satisfies the above example but would probably need some more thorough testing.
from grunt-cucumberjs.
To make this more reliable, the whole flow of the json should be improved.
I noticed that when I console.log
something in a AfterFeatures
handler, the json breaks too :S
from grunt-cucumberjs.
The regex I suggested is a bad one by the way. The first property can as well be a "description"
from grunt-cucumberjs.
@shaneobrien20 @SirLenz0rlot thanks for your inputs. I agree about improving on JSON parsing and do not depend on RegEx for future compatibility.
Let's not parse the JSON based on RegEx, instead read the JSON file created at the end of run. Since Cucumber's formatter -f json: fileName.json
writes the JSON for HTML reporting, it can be used to create HTML.
from grunt-cucumberjs.
Hi @shaneobrien20 @SirLenz0rlot - PR #75 will fix the JSON parsing issue as we do not depend on RegEx anymore. Would you guys mind to test it out by pulling the module thru
"grunt-cucumberjs": "git+ssh://[email protected]/gkushang/grunt-cucumberjs.git#tests"
or
npm i git+ssh://[email protected]/gkushang/grunt-cucumberjs.git#tests
till it's merged and publish?
from grunt-cucumberjs.
I'm afraid it doesn't work for me.
jsonOutput
doesn't seem like valid json to me, as all the console.log() from the test code gets in there too.
I guess this is caused by reading the entire buffer (jsonOutput = Buffer.concat(buffer).toString();
in processHandler
)
from grunt-cucumberjs.
Let's get rid of reading from the buffer!
in cucumber.js:35
, couldn't we just replace:
commands.push('-f', 'json');
by
commands.push('-f', 'json:' + options.output + '.json' );
Then, I think we should remove the saveJson
option (since its always true when enabling html) and in processHandler
throw if the json doesnt exist instead of trying to read from buffer.
Edit: working on a PR
from grunt-cucumberjs.
@SirLenz0rlot Can you share your cucumberjs "options"?
from grunt-cucumberjs.
Published @0.10.1. Here is the CHANGELOG
from grunt-cucumberjs.
Related Issues (20)
- Issue downloading latest grunt-cucumberjs version [V1.0.0] HOT 2
- Issues resolved in fork, waiting on response to PR HOT 4
- Cucumber 2 support HOT 1
- Global variables not persisted through cucumberjs task HOT 1
- {prod} --> npm publish HOT 1
- support for node 0.12
- Breasks with cucumber@4 HOT 1
- Command Injection - Vulnerabilities Observed in dependent package
- Npm audit- Vulnerabilities Observed in dependent package
- html report broken HOT 5
- Submit HTML reporting to cucumber-js HOT 2
- formats html+pretty, pretty won't output HOT 3
- 'Output' option not creating folder structure HOT 1
- Parallel option not working with latest version of plugin HOT 5
- Html report wont open some scenario details but opens others HOT 3
- peerDependencies: 0.4.5
- rerun HOT 1
- Report is overwritten when using re-run option HOT 2
- Issue in '--tags' parameter work logic HOT 1
- Cannot run some feature from cli (Ubuntu) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-cucumberjs.