From e57847227cd67898a0f0de1e40f3ced217d3797b Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Wed, 31 May 2023 10:07:05 +0200 Subject: [PATCH] format fix --- test/parser.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/test/parser.js b/test/parser.js index 7a45e6a..e911778 100644 --- a/test/parser.js +++ b/test/parser.js @@ -1,9 +1,4 @@ -const { - PacketType, - Decoder, - Encoder, - isPacketValid, -} = require(".."); +const { PacketType, Decoder, Encoder, isPacketValid } = require(".."); const expect = require("expect.js"); const helpers = require("./helpers.js"); @@ -155,21 +150,31 @@ describe("socket.io-parser", () => { it("should ensure that a packet is valid", () => { expect(isPacketValid({ type: 0, nsp: "/" })).to.eql(true); - expect(isPacketValid({ type: 0, nsp: "/", data: { foo: "bar" } })).to.eql(true); + expect(isPacketValid({ type: 0, nsp: "/", data: { foo: "bar" } })).to.eql( + true + ); expect(isPacketValid({ type: 1, nsp: "/" })).to.eql(true); expect(isPacketValid({ type: 2, nsp: "/", data: ["foo"] })).to.eql(true); expect(isPacketValid({ type: 2, nsp: "/", data: [1] })).to.eql(true); - expect(isPacketValid({ type: 3, nsp: "/", id: 1, data: ["foo"] })).to.eql(true); + expect(isPacketValid({ type: 3, nsp: "/", id: 1, data: ["foo"] })).to.eql( + true + ); expect(isPacketValid({ type: 4, nsp: "/", data: "foo" })).to.eql(true); - expect(isPacketValid({ type: 4, nsp: "/", data: { foo: "bar" } })).to.eql(true); + expect(isPacketValid({ type: 4, nsp: "/", data: { foo: "bar" } })).to.eql( + true + ); expect(isPacketValid({ type: 9, nsp: "/" })).to.eql(false); expect(isPacketValid({ type: 0 })).to.eql(false); expect(isPacketValid({ type: 0, nsp: 1 })).to.eql(false); expect(isPacketValid({ type: 0, nsp: "/", data: ["foo"] })).to.eql(false); expect(isPacketValid({ type: 1, nsp: "/", data: ["foo"] })).to.eql(false); - expect(isPacketValid({ type: 2, nsp: "/", data: { foo: "bar" } })).to.eql(false); - expect(isPacketValid({ type: 3, nsp: "/", id: "1", data: ["foo"] })).to.eql(false); + expect(isPacketValid({ type: 2, nsp: "/", data: { foo: "bar" } })).to.eql( + false + ); + expect(isPacketValid({ type: 3, nsp: "/", id: "1", data: ["foo"] })).to.eql( + false + ); expect(isPacketValid({ type: 4, nsp: "/" })).to.eql(false); }); });