Skip to content

Commit

Permalink
refactor: switch to the new seconds shorthand
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Selden authored and kellyselden committed Oct 16, 2020
1 parent a6b33c9 commit 80a5b60
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Browser {
latency = 1;
throughput = 1;
} else {
latency = 1 * 1000;
latency = 1e3;
throughput = 25 * 1024;
}
await this._browser.setNetworkConditions({ latency, throughput });
Expand Down
2 changes: 1 addition & 1 deletion packages/lifecycle/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function setUpWebDriver(options) {
browserOverride,
overrides: defaultOverrides,
mocha: global,
timeout: 60 * 1000,
timeout: 60e3,
...options,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/page-objects/src/helpers/date.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const thirtyMins = 30 * 60 * 1000;
const thirtyMins = 30 * 60e3;

function encodeString(original, outOfRange, interval = thirtyMins) {
let now = new Date().getTime();
Expand Down
4 changes: 2 additions & 2 deletions packages/page-objects/test/unit/date-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ describe(function() {
it('should purge if match and not in range', function() {
let name = 'test-name';

sinon.useFakeTimers(new Date().getTime() - 60 * 60 * 1000);
sinon.useFakeTimers(new Date().getTime() - 60 * 60e3);

let oldEncoded = encodeString(name);

sinon.restore();

expect(shouldPurge(oldEncoded, [name], 30 * 60 * 1000)).to.be.true;
expect(shouldPurge(oldEncoded, [name], 30 * 60e3)).to.be.true;
});

it('should purge if match and force not in range', function() {
Expand Down
2 changes: 1 addition & 1 deletion packages/remote/test/acceptance/multiple-browsers-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const {
} = require('../../../remote');

describe(function() {
this.timeout(30 * 1000);
this.timeout(30e3);

before(async function() {
this.webDriver = await startWebDriver();
Expand Down
2 changes: 1 addition & 1 deletion packages/remote/test/integration/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Server = require('../../../../helpers/server');
const sinon = require('sinon');

describe(function() {
this.timeout(10 * 1000);
this.timeout(10e3);

async function startWebDriver({
browser,
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
module.exports = {
browser: 'chrome',
browsers: 1,
timeout: 30 * 1000,
timeout: 30e3,
};
8 changes: 4 additions & 4 deletions test/acceptance.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ describe(function() {
});

it('faltest --retries 1 fixtures/retries-test.js', async function() {
this.timeout(30 * 1000);
this.timeout(30e3);

let output = await this.run();

expect(output).to.include(' 1 passing');
});

it('cross-env FORCE_COLOR=1 mocha fixtures/redact-password-test.js --exit', async function() {
this.timeout(60 * 1000);
this.timeout(60e3);

let output = await this.run();

Expand All @@ -29,7 +29,7 @@ describe(function() {

// more permissive log level
it('cross-env LOG_LEVEL=trace mocha fixtures/redact-password-test.js --exit', async function() {
this.timeout(60 * 1000);
this.timeout(60e3);

let output = await this.run();

Expand All @@ -38,7 +38,7 @@ describe(function() {

// without colors
it('cross-env FORCE_COLOR=0 mocha fixtures/redact-password-test.js --exit', async function() {
this.timeout(60 * 1000);
this.timeout(60e3);

let output = await this.run();

Expand Down
14 changes: 7 additions & 7 deletions test/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe(function() {

describe(getCwd('custom-cli'), function() {
it('yarn start', async function() {
this.timeout(30 * 1000);
this.timeout(30e3);

let output = await this.run();

Expand All @@ -30,7 +30,7 @@ describe(function() {

describe(getCwd('full-suite'), function() {
it('yarn start --target fixtures --env dev --tag user --tag smoke', async function() {
this.timeout(30 * 1000);
this.timeout(30e3);

let output = await this.run();

Expand All @@ -39,7 +39,7 @@ describe(function() {
});

it('yarn start --tag admin --tag !smoke', async function() {
this.timeout(60 * 1000);
this.timeout(60e3);

let output = await this.run();

Expand All @@ -48,7 +48,7 @@ describe(function() {
});

it('yarn start --tag admin --filter unfinished', async function() {
this.timeout(30 * 1000);
this.timeout(30e3);

let output = await this.run();

Expand All @@ -59,7 +59,7 @@ describe(function() {

describe(getCwd('lifecycle-only'), function() {
it('yarn start', async function() {
this.timeout(30 * 1000);
this.timeout(30e3);

let output = await this.run();

Expand All @@ -69,7 +69,7 @@ describe(function() {

describe(getCwd('multiple-browsers'), function() {
it('yarn start', async function() {
this.timeout(30 * 1000);
this.timeout(30e3);

let output = await this.run();

Expand All @@ -79,7 +79,7 @@ describe(function() {

describe(getCwd('runner-only'), function() {
it('yarn start', async function() {
this.timeout(30 * 1000);
this.timeout(30e3);

let output = await this.run();

Expand Down

0 comments on commit 80a5b60

Please sign in to comment.