Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
surma committed Mar 19, 2020
1 parent d6f2105 commit 968768a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"test:unit": "karma start",
"test:types": "tsc -t esnext -m esnext --lib esnext,dom --moduleResolution node --noEmit tests/type-checks.ts",
"test": "npm run fmt_test && npm run build && npm run test:types && npm run test:unit",
"fmt": "prettier --write ./*.{mjs,js,ts,md,json,html} ./{src,docs,tests}/**/*.{mjs,js,ts,md,json,html}",
"fmt_test": "test $(prettier -l ./*.{mjs,js,ts,md,json,html} ./{src,docs,tests}/**/*.{mjs,js,ts,md,json,html} | wc -l) -eq 0",
"fmt": "prettier --write ./*.{mjs,js,ts,md,json,html} ./{src,docs,tests}/{,**/}*.{mjs,js,ts,md,json,html}",
"fmt_test": "test $(prettier -l ./*.{mjs,js,ts,md,json,html} ./{src,docs,tests}/{**/,}*.{mjs,js,ts,md,json,html} | wc -l) -eq 0",
"watchtest": "CHROME_ONLY=1 karma start --no-single-run"
},
"husky": {
Expand Down
19 changes: 11 additions & 8 deletions tests/same_window.comlink.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,14 @@ describe("Comlink in the same realm", function() {

it("can forward an async function error", async function() {
const thing = Comlink.wrap(this.port1);
Comlink.expose({
async throwError() {
throw new Error("Should have thrown");
}
}, this.port2);
Comlink.expose(
{
async throwError() {
throw new Error("Should have thrown");
}
},
this.port2
);
try {
await thing.throwError();
} catch (err) {
Expand Down Expand Up @@ -316,7 +319,7 @@ describe("Comlink in the same realm", function() {
const receive = await thing(array);
expect(array).to.not.equal(receive);
expect(array.byteLength).to.equal(receive.byteLength);
expect([...array]).to.deep.equal([...receive])
expect([...array]).to.deep.equal([...receive]);
});

guardedIt(isNotSafari11_1)("will copy nested TypedArrays", async function() {
Expand All @@ -329,7 +332,7 @@ describe("Comlink in the same realm", function() {
});
expect(array).to.not.equal(receive.array);
expect(array.byteLength).to.equal(receive.array.byteLength);
expect([...array]).to.deep.equal([...receive.array])
expect([...array]).to.deep.equal([...receive.array]);
});

guardedIt(isNotSafari11_1)(
Expand Down Expand Up @@ -542,7 +545,7 @@ describe("Comlink in the same realm", function() {
expect(() => instance.method()).to.throw();
});

it('can proxy with a given target', async function() {
it("can proxy with a given target", async function() {
const thing = Comlink.wrap(this.port1, { value: {} });
Comlink.expose({ value: 4 }, this.port2);
expect(await thing.value).to.equal(4);
Expand Down

0 comments on commit 968768a

Please sign in to comment.