mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
Add assert.containSubset method; refactor to follow latest style instructions (#13690)
This commit is contained in:
@@ -29,6 +29,8 @@ function test_containSubset() {
|
||||
});
|
||||
|
||||
obj.should.containSubset({ a: 'b' });
|
||||
|
||||
assert.containSubset(obj, { a: 'b' });
|
||||
}
|
||||
|
||||
function test_notContainSubset() {
|
||||
@@ -52,6 +54,7 @@ function test_arrayContainSubset() {
|
||||
|
||||
expect(list).to.containSubset([{a:'a', b: 'b'}]);
|
||||
list.should.containSubset([{a:'a', b: 'b'}]);
|
||||
assert.containSubset(list, [{a:'a', b: 'b'}]);
|
||||
}
|
||||
|
||||
function test_arrayNotContainSubset() {
|
||||
|
||||
Vendored
+11
-8
@@ -1,17 +1,20 @@
|
||||
// Type definitions for chai-subset 1.0.0
|
||||
// Type definitions for chai-subset 1.3
|
||||
// Project: https://github.com/e-conomic/chai-subset
|
||||
// Definitions by: Sam Noedel <https://github.com/delta62/>, Andrew Brown <https://github.com/AGBrown>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="chai" />
|
||||
|
||||
declare namespace Chai {
|
||||
interface Assertion {
|
||||
containSubset(obj: Object): Assertion;
|
||||
declare global {
|
||||
namespace Chai {
|
||||
interface Assertion {
|
||||
containSubset(expected: any): Assertion;
|
||||
}
|
||||
interface Assert {
|
||||
containSubset(val: any, exp: any, msg?: string): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare module "chai-subset" {
|
||||
function chaiSubset(chai: any, utils: any): void;
|
||||
export = chaiSubset;
|
||||
}
|
||||
declare function chaiSubset(chai: any, utils: any): void;
|
||||
export = chaiSubset;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user