it("same.members", () => { expect([5, 4]).to.have.same.members([4, 5]); expect([5, 4]).to.have.same.members([5, 4]); expect([5, 4, 4]).to.have.same.members([5, 4, 4]); expect([5, 4]).to.not.have.same.members([]); expect([5, 4]).to.not.have.same.members([6, 3]); expect([5, 4]).to.not.have.same.members([5, 4, 2]); expect([5, 4]).to.not.have.same.members([5, 4, 4]); expect([5, 4, 4]).to.not.have.same.members([5, 4]); expect([5, 4, 4]).to.not.have.same.members([5, 4, 3]); expect([5, 4, 3]).to.not.have.same.members([5, 4, 4]); });
streamAssert (errors, data, files, dirs, symlinks) { expect(errors).to.have.lengthOf(0); expect(data).to.have.same.members(dir.subdir.subsubdir.txt.windowsStyle.fromRoot.data); expect(files).to.have.same.members(dir.subdir.subsubdir.txt.windowsStyle.fromRoot.files); expect(dirs).to.have.same.members(dir.subdir.subsubdir.txt.windowsStyle.fromRoot.dirs); expect(symlinks).to.have.same.members(dir.subdir.subsubdir.txt.windowsStyle.fromRoot.symlinks); }
it("should NOT throw an HTTP 406 if no Accept header is present", (done) => { initTest(() => { supertest .get("/api/pets") .end(helper.checkSpyResults(done)); express.get("/api/pets", helper.spy((req) => { expect(req.headers.accept).to.equal(undefined); expect(req.accepts()).to.have.same.members(["*/*"]); })); }); });
it("does not merge objects and arrays", () => { let resource = new swagger.Resource("/users/JDoe", { name: { first: "John", last: "Doe" } }); resource.merge(["a", "b", "c"]); expect(resource.data).to.be.an("array"); expect(resource.data).to.have.same.members(["a", "b", "c"]); });
streamAssert (errors, data, files, dirs, symlinks) { expect(errors).to.have.lengthOf(0); expect(data).to.have.same.members(dir.deep.symlinks); expect(files).to.have.same.members(dir.symlinks.deep.files); expect(dirs).to.have.same.members(dir.symlinks.deep.dirs); expect(symlinks).to.have.same.members(dir.deep.symlinks); }
streamAssert (errors, data, files, dirs, symlinks) { // The streaming API emits errors and data separately expect(errors).to.have.lengthOf(1); expect(errors[0].code).to.equal("ENOENT"); expect(data).to.have.same.members(["empty.txt", "file.txt"]); expect(files).to.have.same.members(["empty.txt", "file.txt"]); expect(dirs).to.have.lengthOf(0); expect(symlinks).to.have.lengthOf(0); }
streamAssert (errors, data, files, dirs, symlinks) { expect(errors).to.have.lengthOf(0); expect(data).to.have.same.members(this.omitSubdir(dir.deep.data)); expect(files).to.have.same.members(this.omitSubdir(dir.deep.files)); expect(dirs).to.have.same.members(this.omitSubdir(dir.deep.dirs)); expect(symlinks).to.have.same.members(this.omitSubdir(dir.deep.symlinks)); }
streamAssert (errors, data, files, dirs, symlinks) { expect(errors).to.have.lengthOf(0); expect(data).to.have.same.members(dir.shallow.data); expect(files).to.have.same.members(dir.shallow.files); expect(dirs).to.have.same.members(dir.shallow.dirs); expect(symlinks).to.have.same.members(dir.shallow.symlinks); }
streamAssert (errors, data, files, dirs, symlinks) { expect(errors).to.have.lengthOf(0); expect(data).to.have.same.members(this.omitSymlinkDirs(dir.deep.data)); expect(files).to.have.same.members( Array.from(new Set( this.omitSymlinkDirs(dir.deep.files) .concat(this.omitSymlinkDirs(dir.deep.symlinks)))) ); expect(dirs).to.have.same.members(this.omitSymlinks(dir.deep.dirs)); expect(symlinks).to.have.same.members(this.omitSymlinkDirs(dir.deep.symlinks)); }
streamAssert (errors, data, files, dirs, symlinks) { expect(errors).to.have.lengthOf(0); expect(data).to.have.same.members(dir.empties.deep.data); expect(files).to.have.same.members(dir.empties.deep.files); expect(dirs).to.have.same.members(dir.empties.deep.dirs); expect(symlinks).to.have.same.members(dir.empties.deep.symlinks); }
streamAssert (errors, data, files, dirs, symlinks) { expect(errors).to.have.lengthOf(0); expect(data).to.have.same.members(dir.shallow.data); expect(files).to.have.same.members(dir.shallow.files); expect(dirs).to.have.same.members( dir.shallow.dirs.filter(file => file !== "subsubdir-symlink") ); expect(symlinks).to.have.same.members(dir.shallow.symlinks); }
streamAssert (errors, data, files, dirs, symlinks) { expect(errors).to.have.lengthOf(0); expect(data).to.have.same.members(dir.deep.data); expect(files).to.have.same.members(dir.deep.files); expect(dirs).to.have.same.members(dir.deep.dirs); expect(symlinks).to.have.same.members(dir.deep.symlinks); }
streamAssert (errors, data, files, dirs, symlinks) { expect(errors).to.have.lengthOf(0); expect(data).to.have.same.members(dir.empties.shallow.data); expect(files).to.have.same.members(dir.empties.shallow.files); expect(dirs).to.have.same.members(dir.empties.shallow.dirs); expect(symlinks).to.have.same.members(dir.empties.shallow.symlinks); }
streamAssert (errors, data, files, dirs, symlinks) { expect(errors).to.have.lengthOf(0); expect(data).to.have.same.members(dir.deep.data); expect(files).to.have.same.members(dir.deep.files); expect(dirs).to.have.same.members(dir.deep.dirs); expect(symlinks).to.have.same.members(dir.deep.symlinks); }
streamAssert (errors, data, files, dirs, symlinks) { expect(errors).to.have.lengthOf(0); expect(data).to.have.same.members(dir.shallow.data); expect(files).to.have.same.members(dir.shallow.files); expect(dirs).to.have.same.members(dir.shallow.dirs); expect(symlinks).to.have.same.members(dir.shallow.symlinks); }