Skip to content

Commit

Permalink
Merge pull request #35 from browserstack/feature-file-patch
Browse files Browse the repository at this point in the history
Feature file patch
  • Loading branch information
suryart committed Jul 15, 2020
2 parents ffe5723 + 9e59971 commit f3118b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 13 additions & 3 deletions bin/helpers/archiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,24 @@ const archiveSpecs = (runSettings, filePath) => {

archive.pipe(output);

let allowedFileTypes = [ 'js', 'json', 'txt', 'ts' ];
let allowedFileTypes = [ 'js', 'json', 'txt', 'ts', 'feature', 'features' ];
allowedFileTypes.forEach(fileType => {
archive.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: ['node_modules/**', 'package-lock.json', 'package.json', 'browserstack-package.json'] });
});

let packageJSON = {};

if (typeof runSettings.package_config_options === 'object') {
Object.assign(packageJSON, runSettings.package_config_options);
}

if (typeof runSettings.npm_dependencies === 'object') {
var packageJSON = JSON.stringify({devDependencies: runSettings.npm_dependencies}, null, 4);
archive.append(packageJSON, { name: 'browserstack-package.json' });
Object.assign(packageJSON, {devDependencies: runSettings.npm_dependencies});
}

if (Object.keys(packageJSON).length > 0) {
let packageJSONString = JSON.stringify(packageJSON, null, 4);
archive.append(packageJSONString, { name: 'browserstack-package.json' });
}

archive.finalize();
Expand Down
2 changes: 2 additions & 0 deletions bin/templates/configTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ module.exports = function () {
"build_name": "build-name",
"parallels": "Here goes the number of parallels you want to run",
"npm_dependencies": {
},
"package_config_options": {
}
},
"connection_settings": {
Expand Down

0 comments on commit f3118b9

Please sign in to comment.