This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
breaking: represent the feature file tree in sidebar buttons (#41)
BEAKING CHANGE: breaks method param order
- Loading branch information
1 parent
8d47a4e
commit f943279
Showing
15 changed files
with
1,526 additions
and
706 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,9 @@ | ||
#!/usr/bin/env node | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { exec } = require('child_process'); | ||
const Generator = require('../src/Generator'); | ||
|
||
const FILE_ENCODING = 'utf-8'; | ||
|
||
const getFeatureFiles = (directoryName) => { | ||
if (directoryName.endsWith('node_modules')) { | ||
return []; | ||
} | ||
|
||
// Recurse on directories: | ||
const isDirectory = (source) => fs.lstatSync(source).isDirectory(); | ||
const getDirectories = (source) => fs | ||
.readdirSync(source) | ||
.map((name) => path.join(source, name)) | ||
.filter(isDirectory); | ||
const subDirectories = getDirectories(directoryName); | ||
const featureFiles = []; | ||
subDirectories.forEach((subDirectory) => featureFiles.push(...getFeatureFiles(subDirectory))); | ||
|
||
// Add feature files from this directory. | ||
const allFiles = fs.readdirSync(directoryName); | ||
const localFeatureFiles = allFiles.filter((item) => item.endsWith('.feature')); | ||
localFeatureFiles.forEach((featureFileName) => featureFiles.push(`${directoryName}/${featureFileName}`)); | ||
return featureFiles; | ||
}; | ||
|
||
const featureFiles = getFeatureFiles(path.resolve(__dirname, '../')); | ||
new Generator().generate(featureFiles, 'cucumber-forge-report-generator').then((result) => { | ||
fs.writeFileSync(path.resolve(__dirname, '../docs/index.html'), result, FILE_ENCODING); | ||
}); | ||
const report = new Generator().generate(path.resolve(__dirname, '../'), 'cucumber-forge-report-generator') | ||
fs.writeFileSync(path.resolve(__dirname, '../docs/index.html'), report, FILE_ENCODING); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.