Skip to content

Commit f3118b9

Browse files
authored
Merge pull request #35 from browserstack/feature-file-patch
Feature file patch
2 parents ffe5723 + 9e59971 commit f3118b9

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

bin/helpers/archiver.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,24 @@ const archiveSpecs = (runSettings, filePath) => {
3636

3737
archive.pipe(output);
3838

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

44+
let packageJSON = {};
45+
46+
if (typeof runSettings.package_config_options === 'object') {
47+
Object.assign(packageJSON, runSettings.package_config_options);
48+
}
49+
4450
if (typeof runSettings.npm_dependencies === 'object') {
45-
var packageJSON = JSON.stringify({devDependencies: runSettings.npm_dependencies}, null, 4);
46-
archive.append(packageJSON, { name: 'browserstack-package.json' });
51+
Object.assign(packageJSON, {devDependencies: runSettings.npm_dependencies});
52+
}
53+
54+
if (Object.keys(packageJSON).length > 0) {
55+
let packageJSONString = JSON.stringify(packageJSON, null, 4);
56+
archive.append(packageJSONString, { name: 'browserstack-package.json' });
4757
}
4858

4959
archive.finalize();

bin/templates/configTemplate.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ module.exports = function () {
5757
"build_name": "build-name",
5858
"parallels": "Here goes the number of parallels you want to run",
5959
"npm_dependencies": {
60+
},
61+
"package_config_options": {
6062
}
6163
},
6264
"connection_settings": {

0 commit comments

Comments
 (0)