maciejmaciejewski / azure-pipelines-cucumber

MIT License
19 stars 19 forks source link

Does this work with Node version 16? #79

Open KainosShamusHarkin opened 1 year ago

KainosShamusHarkin commented 1 year ago

Hi, I am trying to get this plugin configured for my Azure pipeline. I have seen other issues about the plugin working in Node 12 but having issues in Node 16. I am running Node 16 and i am getting the following error:

============================================================================== Task : Publish Cucumber Report Description : Publish Cucumber Report Version : 1.0.9 Author : Maciej Maciejewski Help : Replace with markdown to show in help

/usr/bin/npm install

up to date, audited 22 packages in 431ms

found 0 vulnerabilities
Found 1 matching /home/azure_devops_agents/_work/_work/1/s/Test-Framework/target/cucumber-json/ pattern
Processing /home/azure_devops_agents/_work/_work/1/s/Test-Framework/target/cucumber-json/report.json
Saving modified report as /home/azure_devops_agents/_work/_work/1/s/Test-Framework/target/cucumber-json/report.json
/usr/bin/node script.js
/home/azure_devops_agents/_work/_work/_tasks/PublishCucumberReport_83c082c0-5032-11ea-8fab-bbe0f0fcf287/1.0.9/reporter/node_modules/cucumber-html-reporter/lib/jsonDir.js:26
            throw new Error('Invalid Cucumber JSON file found under ' + options.jsonDir + ': ' + file);
            ^

Error: Invalid Cucumber JSON file found under /home/azure_devops_agents/_work/_work/1/s/Test-Framework/target/cucumber-json/: /home/azure_devops_agents/_work/_work/1/s/Test-Framework/target/cucumber-json/report.json
    at mergeJSONS (/home/azure_devops_agents/_work/_work/_tasks/PublishCucumberReport_83c082c0-5032-11ea-8fab-bbe0f0fcf287/1.0.9/reporter/node_modules/cucumber-html-reporter/lib/jsonDir.js:26:19)
    at Array.map (<anonymous>)
    at Object.collectJSONS (/home/azure_devops_agents/_work/_work/_tasks/PublishCucumberReport_83c082c0-5032-11ea-8fab-bbe0f0fcf287/1.0.9/reporter/node_modules/cucumber-html-reporter/lib/jsonDir.js:48:11)
    at Object.generate (/home/azure_devops_agents/_work/_work/_tasks/PublishCucumberReport_83c082c0-5032-11ea-8fab-bbe0f0fcf287/1.0.9/reporter/node_modules/cucumber-html-reporter/lib/reporter.js:537:17)
    at generateReport (/home/azure_devops_agents/_work/_work/_tasks/PublishCucumberReport_83c082c0-5032-11ea-8fab-bbe0f0fcf287/1.0.9/reporter/node_modules/cucumber-html-reporter/index.js:30:21)
    at Object.<anonymous> (/home/azure_devops_agents/_work/_work/_tasks/PublishCucumberReport_83c082c0-5032-11ea-8fab-bbe0f0fcf287/1.0.9/reporter/script.js:20:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
##[warning]Error: Failed to run script
Finishing: Publish Cucumber Report

This is where I declare the plugin in my Cucumber options: plugin = {"json:target/cucumber-json/report.json"},

This is the task I create in my YAML:

Any help is much appreciated Thanks Shamus