Skip to content

Commit

Permalink
Renaming QueuePlugin although tests are failing locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Gaunt committed Nov 30, 2017
1 parent fe890f3 commit e70647a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import './_version.mjs';
*
* @memberof workbox.backgroundSync
*/
class QueuePlugin {
class Plugin {
/**
* @param {...*} queueArgs Args to forward to the composed Queue instance.
* See the [Queue]{@link workbox.backgroundSync.Queue} documentation for
Expand All @@ -43,4 +43,4 @@ class QueuePlugin {
}
}

export {QueuePlugin};
export {Plugin};
4 changes: 2 additions & 2 deletions packages/workbox-background-sync/_public.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
*/

import {Queue} from './Queue.mjs';
import {QueuePlugin} from './QueuePlugin.mjs';
import {Plugin} from './Plugin.mjs';
import './_version.mjs';

export {
Queue,
QueuePlugin,
Plugin,
};
6 changes: 3 additions & 3 deletions packages/workbox-google-analytics/_default.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
limitations under the License.
*/

import {QueuePlugin} from 'workbox-background-sync/QueuePlugin.mjs';
import {Plugin} from 'workbox-background-sync/Plugin.mjs';
import {cacheNames} from 'workbox-core/_private/cacheNames.mjs';
import {Route} from 'workbox-routing/Route.mjs';
import {Router} from 'workbox-routing/Router.mjs';
Expand Down Expand Up @@ -97,7 +97,7 @@ const createRequestWillReplayCallback = (config) => {
/**
* Creates GET and POST routes to catch failed Measurement Protocol hits.
*
* @param {QueuePlugin} queuePlugin
* @param {Plugin} queuePlugin
* @return {Array<Route>} The created routes.
*
* @private
Expand Down Expand Up @@ -167,7 +167,7 @@ const createGtagJsRoute = (cacheName) => {
const initialize = (options = {}) => {
const cacheName = cacheNames.getGoogleAnalyticsName(options.cacheName);

const queuePlugin = new QueuePlugin(QUEUE_NAME, {
const queuePlugin = new Plugin(QUEUE_NAME, {
maxRetentionTime: MAX_RETENTION_TIME,
callbacks: {
requestWillReplay: createRequestWillReplayCallback(options),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import {expect} from 'chai';
import sinon from 'sinon';
import {Queue} from
'../../../../packages/workbox-background-sync/Queue.mjs';
import {QueuePlugin} from
'../../../../packages/workbox-background-sync/QueuePlugin.mjs';
import {Plugin} from
'../../../../packages/workbox-background-sync/Plugin.mjs';

describe(`[workbox-background-sync] QueuePlugin`, function() {
describe(`[workbox-background-sync] Plugin`, function() {
const sandbox = sinon.sandbox.create();

beforeEach(function() {
Expand All @@ -33,14 +33,14 @@ describe(`[workbox-background-sync] QueuePlugin`, function() {

describe(`constructor`, function() {
it(`should store a Queue instance`, async function() {
const queuePlugin = new QueuePlugin('foo');
const queuePlugin = new Plugin('foo');
expect(queuePlugin._queue).to.be.instanceOf(Queue);
});

it(`should implement fetchDidFail and add requests to the queue`,
async function() {
sandbox.stub(Queue.prototype, 'addRequest');
const queuePlugin = new QueuePlugin('foo');
const queuePlugin = new Plugin('foo');

queuePlugin.fetchDidFail({request: new Request('/')});
expect(Queue.prototype.addRequest.calledOnce).to.be.true;
Expand Down

0 comments on commit e70647a

Please sign in to comment.