Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyBelym committed Dec 27, 2018
1 parent 985ce80 commit a843fa5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/cli/argument-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ export default class CLIArgumentParser {
}

async _parseVideoOptions () {
this.opts.video = typeof this.opts.video === 'string' ? await getVideoOptions(this.opts.video) : {};
this.opts.advancedVideoOptions = typeof this.opts.videoOptions === 'string' ? await getVideoOptions(this.opts.videoOptions) : {};
this.opts.video = typeof this.opts.video === 'string' ? await getVideoOptions(this.opts.video) : null;
this.opts.advancedVideoOptions = typeof this.opts.videoOptions === 'string' ? await getVideoOptions(this.opts.videoOptions) : null;
}

_getProviderName () {
Expand Down
4 changes: 2 additions & 2 deletions src/configuration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ export default class Configuration {
}

async _prepareSslOptions () {
let sslOptions = this._options[OPTION_NAMES.ssl];
const sslOptions = this._options[OPTION_NAMES.ssl];

if (!sslOptions)
return;

sslOptions = await getSSLOptions(sslOptions);
sslOptions.value = await getSSLOptions(sslOptions.value);
}

_ensureOption (name, value, source) {
Expand Down
2 changes: 1 addition & 1 deletion src/runner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default class Runner extends EventEmitter {
if (!videoConfig)
return;

videoConfig.basePath = resolvePath(videoConfig.basePath);
videoConfig.basePath = resolvePath(videoConfig.basePath || '');

if (videoConfig.ffmpegPath)
videoConfig.ffmpegPath = resolvePath(videoConfig.ffmpegPath);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/convert-to-best-fit-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const BOOLEAN_STRING_VALUES = ['true', 'false'];

export default function (valueStr) {
if (typeof valueStr !== 'string')
return void 0;
return valueStr;

else if (NUMBER_REG_EX.test(valueStr))
return parseFloat(valueStr);
Expand Down
4 changes: 3 additions & 1 deletion test/server/cli-argument-parser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,9 @@ describe('CLI argument parser', function () {
{ long: '--color' },
{ long: '--no-color' },
{ long: '--stop-on-first-fail', short: '--sf' },
{ long: '--disable-test-syntax-validation' }
{ long: '--disable-test-syntax-validation' },
{ long: '--video' },
{ long: '--video-options' }
];

const parser = new CliArgumentParser('');
Expand Down
4 changes: 2 additions & 2 deletions test/server/path-pattern-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ describe('Screenshot path pattern', () => {
it('Normal run', () => {
const pathPattern = createPathPattern();

expect(pathPattern.pattern).eql('${DATE}_${TIME}\\test-${TEST_INDEX}\\${USERAGENT}\\${FILE_INDEX}.png');
expect(pathPattern.pattern).eql('${DATE}_${TIME}\\test-${TEST_INDEX}\\${USERAGENT}\\${FILE_INDEX}');
});

it('Quarantine mode', () => {
const pathPattern = createPathPattern(void 0, { quarantineAttempt: 1 });

expect(pathPattern.pattern).eql('${DATE}_${TIME}\\test-${TEST_INDEX}\\run-${QUARANTINE_ATTEMPT}\\${USERAGENT}\\${FILE_INDEX}.png');
expect(pathPattern.pattern).eql('${DATE}_${TIME}\\test-${TEST_INDEX}\\run-${QUARANTINE_ATTEMPT}\\${USERAGENT}\\${FILE_INDEX}');
});
});

Expand Down

0 comments on commit a843fa5

Please sign in to comment.