diff --git a/types/deep-equal-in-any-order/deep-equal-in-any-order-tests.ts b/types/deep-equal-in-any-order/deep-equal-in-any-order-tests.ts new file mode 100644 index 0000000000..f8fe278708 --- /dev/null +++ b/types/deep-equal-in-any-order/deep-equal-in-any-order-tests.ts @@ -0,0 +1,13 @@ +import { expect, use } from 'chai'; +import deepEqualInAnyOrder = require('deep-equal-in-any-order'); + +use(deepEqualInAnyOrder); + +expect([1, 2]).to.deep.equalInAnyOrder([2, 1]); +expect([1, 2]).to.not.deep.equalInAnyOrder([2, 1, 3]); +expect({ foo: [1, 2], bar: [4, 89, 22] }).to.deep.equalInAnyOrder({ foo: [2, 1], bar: [4, 22, 89] }); +expect({ foo: ['foo-1', 'foo-2', [1, 2], null] }).to.deep.equalInAnyOrder({ foo: [null, [1, 2], 'foo-1', 'foo-2'] }); +expect({ foo: [1, 2], bar: { baz: ['a', 'b', { lorem: [5, 6] }] } }).to.deep.equalInAnyOrder({ + foo: [2, 1], + bar: { baz: ['b', 'a', { lorem: [6, 5] }] } +}); diff --git a/types/deep-equal-in-any-order/index.d.ts b/types/deep-equal-in-any-order/index.d.ts new file mode 100644 index 0000000000..d0e646d64e --- /dev/null +++ b/types/deep-equal-in-any-order/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for deep-equal-in-any-order 1.0 +// Project: https://github.com/oprogramador/deep-equal-in-any-order#readme +// Definitions by: Bastien Caudan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare global { + namespace Chai { + interface Deep { + equalInAnyOrder: Equal; + } + } +} + +declare function deepEqualInAnyOrder(chai: any, utils: any): void; +export = deepEqualInAnyOrder; diff --git a/types/deep-equal-in-any-order/tsconfig.json b/types/deep-equal-in-any-order/tsconfig.json new file mode 100644 index 0000000000..4a70c15618 --- /dev/null +++ b/types/deep-equal-in-any-order/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "deep-equal-in-any-order-tests.ts" + ] +} diff --git a/types/deep-equal-in-any-order/tslint.json b/types/deep-equal-in-any-order/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/deep-equal-in-any-order/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }