Skip to content

Commit

Permalink
Merge pull request #298 from tshaddix/lint-fix
Browse files Browse the repository at this point in the history
Fix linting globs
  • Loading branch information
SidneyNemzer authored Jul 10, 2024
2 parents 11fc660 + 5cf81e1 commit a29143b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"typings": "./index.d.ts",
"scripts": {
"umd-build": "rollup -c",
"build": "./node_modules/.bin/babel src --out-dir lib && npm run umd-build",
"lint-src": "./node_modules/.bin/eslint src/**/*.js",
"lint-test": "./node_modules/.bin/eslint test/**/*.js",
"build": "babel src --out-dir lib && npm run umd-build",
"lint-src": "eslint src/{**/,}*.js",
"lint-test": "eslint test/{**/,}*.js",
"lint": "npm run lint-src && npm run lint-test",
"prepublishOnly": "npm run build",
"pretest": "./node_modules/.bin/babel src --out-dir lib",
"test-run": "./node_modules/.bin/mocha --require @babel/register --recursive",
"pretest": "babel src --out-dir lib",
"test-run": "mocha --require @babel/register --recursive",
"test": "npm run lint && npm run test-run"
},
"repository": {
Expand Down
32 changes: 16 additions & 16 deletions test/wrapStore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { createWrapStore } from '../src';
import shallowDiff from '../src/strategies/shallowDiff/diff';
import { DISPATCH_TYPE, STATE_TYPE, PATCH_STATE_TYPE } from '../src/constants';

describe('wrapStore', function() {
describe('wrapStore', function () {
const channelName = 'test';

beforeEach(function() {
beforeEach(function () {
global.self = {};
const tabs = [1];

Expand Down Expand Up @@ -62,10 +62,10 @@ describe('wrapStore', function() {
return listeners;
}

describe("on receiving messages", function() {
describe("on receiving messages", function () {
let listeners, store, payload, message, sender, callback;

beforeEach(function() {
beforeEach(function () {
listeners = setupListeners();
store = {
dispatch: sinon.spy(),
Expand All @@ -87,7 +87,7 @@ describe('wrapStore', function() {
callback = () => { }; // noop. Maybe should validate it is invoked?
});

it('should dispatch actions received on onMessage to store', async function() {
it('should dispatch actions received on onMessage to store', async function () {
const wrapStore = createWrapStore();

wrapStore(store, { channelName });
Expand All @@ -105,7 +105,7 @@ describe('wrapStore', function() {
.should.eql(true);
});

it('should not dispatch actions received on onMessage for other ports', function() {
it('should not dispatch actions received on onMessage for other ports', function () {
const wrapStore = createWrapStore();

wrapStore(store, { channelName });
Expand All @@ -115,7 +115,7 @@ describe('wrapStore', function() {
store.dispatch.notCalled.should.eql(true);
});

it('should deserialize incoming messages correctly', async function() {
it('should deserialize incoming messages correctly', async function () {
const deserializer = sinon.spy(JSON.parse);
const wrapStore = createWrapStore();

Expand All @@ -135,7 +135,7 @@ describe('wrapStore', function() {
.should.eql(true);
});

it('should not deserialize incoming messages for other ports', function() {
it('should not deserialize incoming messages for other ports', function () {
const deserializer = sinon.spy(JSON.parse);
const wrapStore = createWrapStore();

Expand All @@ -148,7 +148,7 @@ describe('wrapStore', function() {
});
});

it('should serialize initial state and subsequent patches correctly', function() {
it('should serialize initial state and subsequent patches correctly', function () {
const sendMessage = (self.chrome.tabs.sendMessage = sinon.spy());

// Mock store subscription
Expand Down Expand Up @@ -195,7 +195,7 @@ describe('wrapStore', function() {
sendMessage.secondCall.args[1].should.eql(expectedPatchMessage);
});

it('should use the provided diff strategy', function() {
it('should use the provided diff strategy', function () {
const sendMessage = (self.chrome.tabs.sendMessage = sinon.spy());

// Mock store subscription
Expand Down Expand Up @@ -240,7 +240,7 @@ describe('wrapStore', function() {
sendMessage.secondCall.args[1].should.eql(expectedPatchMessage);
});

describe("when validating options", function() {
describe("when validating options", function () {
const store = {
dispatch: sinon.spy(),
subscribe: () => {
Expand All @@ -249,31 +249,31 @@ describe('wrapStore', function() {
getState: () => ({})
};

it('should use defaults if no options present', function() {
it('should use defaults if no options present', function () {
should.doesNotThrow(() => {
const wrapStore = createWrapStore();

wrapStore(store);
});
});

it('should throw an error if serializer is not a function', function() {
it('should throw an error if serializer is not a function', function () {
should.throws(() => {
const wrapStore = createWrapStore();

wrapStore(store, { channelName, serializer: "abc" });
}, Error);
});

it('should throw an error if deserializer is not a function', function() {
it('should throw an error if deserializer is not a function', function () {
should.throws(() => {
const wrapStore = createWrapStore();

wrapStore(store, { channelName, deserializer: "abc" });
}, Error);
});

it('should throw an error if diffStrategy is not a function', function() {
it('should throw an error if diffStrategy is not a function', function () {
should.throws(() => {
const wrapStore = createWrapStore();

Expand All @@ -284,7 +284,7 @@ describe('wrapStore', function() {

it(
'should send a safety message to all tabs once initialized',
function() {
function () {
const tabs = [123, 456, 789, 1011, 1213];
const tabResponders = [];
const store = {
Expand Down

0 comments on commit a29143b

Please sign in to comment.