Skip to content

Commit fb872b5

Browse files
committed
Added sync no wrap specs for utils and updated code based on env value
1 parent c48af19 commit fb872b5

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

bin/helpers/sync/syncSpecsLogs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let specSummary = {
1313
"specs": [],
1414
"duration": null
1515
}
16-
let noWrap = (process.env.SYNC_NO_WRAP || false);
16+
let noWrap = (process.env.SYNC_NO_WRAP && (process.env.SYNC_NO_WRAP === 'true'));
1717
let terminalWidth = (process.stdout.columns) * 0.9;
1818
let lineSeparator = "\n" + "-".repeat(terminalWidth);
1919
// Do not show the separator based on terminal width if no-wrap provided.

test/unit/bin/helpers/utils.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,44 @@ describe('utils', () => {
600600
});
601601
});
602602

603+
describe('setNoWrap', () => {
604+
it('sets the no-wrap to process.env.SYNC_NO_WRAP to true', () => {
605+
let args = {
606+
noWrap: true
607+
};
608+
let bsConfig = {
609+
run_settings: {}
610+
};
611+
612+
utils.setNoWrap(bsConfig, args);
613+
expect(process.env.SYNC_NO_WRAP).to.be.eq('true');
614+
});
615+
616+
it('false to not set the no-wrap to process.env.SYNC_NO_WRAP to true', () => {
617+
let args = {
618+
noWrap: false
619+
};
620+
let bsConfig = {
621+
run_settings: {}
622+
};
623+
624+
utils.setNoWrap(bsConfig, args);
625+
expect(process.env.SYNC_NO_WRAP).to.be.eq('false');
626+
});
627+
628+
it('string to not set the no-wrap to process.env.SYNC_NO_WRAP to true', () => {
629+
let args = {
630+
noWrap: "true"
631+
};
632+
let bsConfig = {
633+
run_settings: {}
634+
};
635+
636+
utils.setNoWrap(bsConfig, args);
637+
expect(process.env.SYNC_NO_WRAP).to.be.eq('false');
638+
});
639+
});
640+
603641
describe('exportResults', () => {
604642
it('should export results to log/build_results.txt', () => {
605643
sinon.stub(fs, 'writeFileSync').returns(true);

0 commit comments

Comments
 (0)