Skip to content

Commit

Permalink
Update dependency prettier to v2 (#3386)
Browse files Browse the repository at this point in the history
* Update dependency prettier to v2

* update configuration

* add parenthese

* run prettier

Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Feiyang1 <[email protected]>
  • Loading branch information
3 people authored Jul 10, 2020
1 parent 340d715 commit 55f09a2
Show file tree
Hide file tree
Showing 109 changed files with 729 additions and 966 deletions.
6 changes: 4 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
singleQuote: true,
printWidth: 80,
quoteProps: preserve
}
quoteProps: preserve,
trailingComma: none,
arrowParens: avoid
}
2 changes: 1 addition & 1 deletion config/karma.saucelabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function appiumLauncher(
};
}

module.exports = function(config) {
module.exports = function (config) {
const { packageName, files: testFiles } = getTestFiles();
const sauceLabsBrowsers = getSauceLabsBrowsers(packageName);

Expand Down
4 changes: 2 additions & 2 deletions integration/browserify/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Copyright 2017 Google Inc.
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@ const karmaBase = require('../../config/karma.base');

const files = [`dist/**/*`];

module.exports = function(config) {
module.exports = function (config) {
const karmaConfig = Object.assign({}, karmaBase, {
// files to load into karma
files: files,
Expand Down
4 changes: 2 additions & 2 deletions integration/browserify/src/namespace.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Copyright 2017 Google Inc.
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,6 +29,6 @@ firebase.initializeApp({
appId: 'myAppId'
});

describe('Firebase Namespace Validation', function() {
describe('Firebase Namespace Validation', function () {
validateNamespace(namespaceDefinition, firebase);
});
2 changes: 1 addition & 1 deletion integration/firestore/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const karmaBase = require('../../config/karma.base');

const files = ['./dist/test-harness.js'];

module.exports = function(config) {
module.exports = function (config) {
const karmaConfig = Object.assign({}, karmaBase, {
// files to load into karma
files: files,
Expand Down
16 changes: 8 additions & 8 deletions integration/messaging/test/test-deleteToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ const createPermittedWebDriver = require('./utils/createPermittedWebDriver');
const TEST_SUITE_TIMEOUT_MS = 100000;
const TEST_DOMAIN = 'valid-vapid-key';

describe('Firebase Messaging Integration Tests > get and delete token', function() {
describe('Firebase Messaging Integration Tests > get and delete token', function () {
this.timeout(TEST_SUITE_TIMEOUT_MS);
this.retries(3);
let globalWebDriver;

before(async function() {
before(async function () {
await testServer.start();
});

after(async function() {
after(async function () {
await testServer.stop();
});

Expand All @@ -46,8 +46,8 @@ describe('Firebase Messaging Integration Tests > get and delete token', function
return;
}

describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function() {
before(async function() {
describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function () {
before(async function () {
// Use one webDriver per browser instead of one per test to speed up test.
globalWebDriver = createPermittedWebDriver(
/* browser= */ assistantBrowser.getId()
Expand All @@ -58,15 +58,15 @@ describe('Firebase Messaging Integration Tests > get and delete token', function
);
});

after(async function() {
after(async function () {
await seleniumAssistant.killWebDriver(globalWebDriver);
});

afterEach(async function() {
afterEach(async function () {
await clearAppForTest(globalWebDriver);
});

it(`Test app can delete a valid token`, async function() {
it(`Test app can delete a valid token`, async function () {
const token = await retrieveToken(globalWebDriver);
expect(token).to.exist;
try {
Expand Down
22 changes: 11 additions & 11 deletions integration/messaging/test/test-send.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ const WAIT_TIME_BEFORE_RETRIEVING_BACKGROUND_MESSAGES_MILLISECONDS = 60000;

const wait = ms => new Promise(res => setTimeout(res, ms));

describe('Starting Integration Test > Sending and Receiving ', function() {
describe('Starting Integration Test > Sending and Receiving ', function () {
this.retries(3);
let globalWebDriver;

before(async function() {
before(async function () {
await testServer.start();
});

after(async function() {
after(async function () {
await testServer.stop();
});

Expand All @@ -61,14 +61,14 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
return;
}

describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function() {
before(async function() {
describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function () {
before(async function () {
globalWebDriver = createPermittedWebDriver(
/* browser= */ assistantBrowser.getId()
);
});

it('Background app can receive a {} empty message from sw', async function() {
it('Background app can receive a {} empty message from sw', async function () {
this.timeout(TIMEOUT_BACKGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);

// Clearing the cache and db data by killing the previously instantiated driver. Note that ideally this call is placed inside the after/before hooks. However, Mocha forbids operations longer than 2s in hooks. Hence, this clearing call needs to be inside the test unit.
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
);
});

it('Background app can receive a {"data"} message frow sw', async function() {
it('Background app can receive a {"data"} message frow sw', async function () {
this.timeout(TIMEOUT_BACKGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);

await seleniumAssistant.killWebDriver(globalWebDriver);
Expand Down Expand Up @@ -126,7 +126,7 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
);
});

it('Foreground app can receive a {} empty message in onMessage', async function() {
it('Foreground app can receive a {} empty message in onMessage', async function () {
this.timeout(TIMEOUT_FOREGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);

await seleniumAssistant.killWebDriver(globalWebDriver);
Expand All @@ -153,7 +153,7 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
);
});

it('Foreground app can receive a {"notification"} message in onMessage', async function() {
it('Foreground app can receive a {"notification"} message in onMessage', async function () {
this.timeout(TIMEOUT_FOREGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);

await seleniumAssistant.killWebDriver(globalWebDriver);
Expand All @@ -180,7 +180,7 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
);
});

it('Foreground app can receive a {"data"} message in onMessage', async function() {
it('Foreground app can receive a {"data"} message in onMessage', async function () {
this.timeout(TIMEOUT_FOREGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);

await seleniumAssistant.killWebDriver(globalWebDriver);
Expand All @@ -207,7 +207,7 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
);
});

it('Foreground app can receive a {"notification", "data"} message in onMessage', async function() {
it('Foreground app can receive a {"notification", "data"} message in onMessage', async function () {
this.timeout(TIMEOUT_FOREGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);

await seleniumAssistant.killWebDriver(globalWebDriver);
Expand Down
16 changes: 8 additions & 8 deletions integration/messaging/test/test-updateToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ const getErrors = require('./utils/getErrors');
const TEST_SUITE_TIMEOUT_MS = 70000;
const TEST_DOMAIN = 'valid-vapid-key';

describe('Firebase Messaging Integration Tests > update a token', function() {
describe('Firebase Messaging Integration Tests > update a token', function () {
this.timeout(TEST_SUITE_TIMEOUT_MS);
this.retries(3);

let globalWebDriver;

before(async function() {
before(async function () {
await testServer.start();
});

after(async function() {
after(async function () {
await testServer.stop();
});

Expand All @@ -49,8 +49,8 @@ describe('Firebase Messaging Integration Tests > update a token', function() {
return;
}

describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function() {
before(async function() {
describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function () {
before(async function () {
// Use one webDriver per browser instead of one per test to speed up test.
globalWebDriver = createPermittedWebDriver(
/* browser= */ assistantBrowser.getId()
Expand All @@ -60,15 +60,15 @@ describe('Firebase Messaging Integration Tests > update a token', function() {
);
});

after(async function() {
after(async function () {
await seleniumAssistant.killWebDriver(globalWebDriver);
});

afterEach(async function() {
afterEach(async function () {
await clearAppForTest(globalWebDriver);
});

it(`should update a token`, async function() {
it(`should update a token`, async function () {
const token = await retrieveToken(globalWebDriver);
expect(token).to.exist;

Expand Down
10 changes: 5 additions & 5 deletions integration/messaging/test/test-useDefaultServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,31 @@ const createPermittedWebDriver = require('./utils/createPermittedWebDriver');
const TEST_DOMAIN = 'default-sw';
const TEST_SUITE_TIMEOUT_MS = 70000;

describe(`Firebase Messaging Integration Tests > Use 'firebase-messaging-sw.js' by default`, function() {
describe(`Firebase Messaging Integration Tests > Use 'firebase-messaging-sw.js' by default`, function () {
this.timeout(TEST_SUITE_TIMEOUT_MS);

this.retries(3);

let globalWebDriver;

before(async function() {
before(async function () {
await testServer.start();
});

after(async function() {
after(async function () {
await testServer.stop();
await seleniumAssistant.killWebDriver(globalWebDriver);
});

it(`should use default SW by default`, async function() {
it(`should use default SW by default`, async function () {
globalWebDriver = createPermittedWebDriver('chrome');
await globalWebDriver.get(`${testServer.serverAddress}/${TEST_DOMAIN}/`);

// If we have a token, then we know the default SW worked.
const token = await retrieveToken(globalWebDriver);
expect(token).to.exist;

const result = await globalWebDriver.executeAsyncScript(function(cb) {
const result = await globalWebDriver.executeAsyncScript(function (cb) {
navigator.serviceWorker
.getRegistrations()
.then(swReg => {
Expand Down
8 changes: 4 additions & 4 deletions integration/messaging/test/test-useValidManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ const createPermittedWebDriver = require('./utils/createPermittedWebDriver');
const TEST_DOMAIN = 'valid-manifest';
const TEST_SUITE_TIMEOUT_MS = 70000;

describe(`Firebase Messaging Integration Tests > Use 'use valid manifest`, function() {
describe(`Firebase Messaging Integration Tests > Use 'use valid manifest`, function () {
this.timeout(TEST_SUITE_TIMEOUT_MS);

this.retries(3);

let globalWebDriver;

before(async function() {
before(async function () {
await testServer.start();
});

after(async function() {
after(async function () {
await testServer.stop();
await seleniumAssistant.killWebDriver(globalWebDriver);
});

it(`should allow valid manifest`, async function() {
it(`should allow valid manifest`, async function () {
globalWebDriver = createPermittedWebDriver('chrome');
await globalWebDriver.get(`${testServer.serverAddress}/${TEST_DOMAIN}/`);

Expand Down
10 changes: 5 additions & 5 deletions integration/shared/validator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Copyright 2017 Google Inc.
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,8 +22,8 @@ function validateNamespace(definition, candidate) {
const keys = Object.keys(definition).filter(key => !~key.indexOf('__'));

if (!validatedVersion) {
describe('Firebase SDK Version', function() {
it('Should be properly defined', function() {
describe('Firebase SDK Version', function () {
it('Should be properly defined', function () {
__expect(candidate.SDK_VERSION).to.equal(
require('../../packages/firebase/package.json').version
);
Expand Down Expand Up @@ -54,12 +54,12 @@ function validateNamespace(definition, candidate) {
iKey => ~iKey.indexOf('__return')
);

describe(`${key}`, function() {
describe(`${key}`, function () {
/**
* Tests of the actual API
*/
if (definitionChunk.__type) {
it(`Should be a \`${definitionChunk.__type}\``, function() {
it(`Should be a \`${definitionChunk.__type}\``, function () {
__expect(candidateChunk).to.be.a(definitionChunk.__type);
});
}
Expand Down
4 changes: 2 additions & 2 deletions integration/typescript/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Copyright 2017 Google Inc.
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@ const karmaBase = require('../../config/karma.base');

const files = ['test/**/*.test.*'];

module.exports = function(config) {
module.exports = function (config) {
const karmaConfig = Object.assign({}, karmaBase, {
// files to load into karma
files: files,
Expand Down
2 changes: 1 addition & 1 deletion integration/typescript/test/namespace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ firebase.initializeApp({
appId: 'myAppId'
});

describe('Firebase Namespace Validation', function() {
describe('Firebase Namespace Validation', function () {
validateNamespace(namespaceDefinition, firebase);
});
4 changes: 2 additions & 2 deletions integration/webpack/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Copyright 2017 Google Inc.
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@ const karmaBase = require('../../config/karma.base');

const files = [`dist/**/*`];

module.exports = function(config) {
module.exports = function (config) {
const karmaConfig = Object.assign({}, karmaBase, {
// files to load into karma
files: files,
Expand Down
Loading

0 comments on commit 55f09a2

Please sign in to comment.