mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* chai: Add types for chai.use and chai.util Helps developers write Chai plugins; requested in #29922. Closes #29922. * Updated dependencies on Chai - Minimum TS version: 3.0 - Version bumps to TS 3.0 for the following type definitions which depend on chai directly or indirectly: bardjs, chai, chai-almost, chai-arrays, chai-as-promised, chai-datetime, chai-dom, chai-enzyme, chai-fs, chai-fuzzy, chai-jest-snapshot, chai-jquery, chai-json-schema, chai-moment, chai-oequal, chai-roughly, chai-spies, chai-string, chai-subset, chai-things, chai-uuid, chai-webdriverio, chai-xml, d3kit, deep-equal-in-any-order, dirty-chai, ember-mocha, hexo, hexo-log, hexo-util, jsx-chai, karma-chai, karma-chai-sinon, redux-test-utils, and sinon-chai - Use Chai.ChaiPlugin instead of (chai: any, utils: any) => void * Factor out pathval types - Forgot that the pathval types aren't merged yet * Factor out pathval types - Forgot that the pathval types aren't merged yet * Make 'chainingBehavior' non-mandatory
78 lines
2.7 KiB
TypeScript
78 lines
2.7 KiB
TypeScript
// Type definitions for chai-fuzzy 1.3.0
|
|
// Project: http://chaijs.com/plugins/chai-fuzzy
|
|
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 3.0
|
|
|
|
/// <reference types="chai" />
|
|
|
|
declare global {
|
|
namespace Chai {
|
|
interface Assertion {
|
|
/**
|
|
* Compare object attributes and values rather than checking to see if
|
|
* they're the same reference.
|
|
*/
|
|
like(expected: any, message?: string): Assertion;
|
|
/**
|
|
* Compare object attributes and values rather than checking to see if
|
|
* they're the same reference.
|
|
*/
|
|
notLike(expected: any, message?: string): Assertion;
|
|
/**
|
|
* Check the first level of the container for a value like the one provided.
|
|
*/
|
|
containOneLike(expected: any, message?: string): Assertion;
|
|
/**
|
|
* Check the first level of the container for a value like the one provided.
|
|
*/
|
|
notContainOneLike(expected: any, message?: string): Assertion;
|
|
/**
|
|
* Check that the given javascript object is like the JSON-ified expected
|
|
* value. Useful for checking stringification and parsing of an object.
|
|
*/
|
|
jsonOf(expected: any, message?: string): Assertion;
|
|
/**
|
|
* Check that the given javascript object is like the JSON-ified expected
|
|
* value. Useful for checking stringification and parsing of an object.
|
|
*/
|
|
notJsonOf(expected: any, message?: string): Assertion;
|
|
}
|
|
|
|
interface Assert {
|
|
/**
|
|
* Compare object attributes and values rather than checking to see if
|
|
* they're the same reference.
|
|
*/
|
|
like(actual: any, expected: any, message?: string): void;
|
|
/**
|
|
* Compare object attributes and values rather than checking to see if
|
|
* they're the same reference.
|
|
*/
|
|
notLike(actual: any, expected: any, message?: string): void;
|
|
/**
|
|
* Check the first level of the container for a value like the one provided.
|
|
*/
|
|
containOneLike(actual: any, expected: any, message?: string): void;
|
|
/**
|
|
* Check the first level of the container for a value like the one provided.
|
|
*/
|
|
notContainOneLike(actual: any, expected: any, message?: string): void;
|
|
/**
|
|
* Check that the given javascript object is like the JSON-ified expected
|
|
* value. Useful for checking stringification and parsing of an object.
|
|
*/
|
|
jsonOf(actual: any, expected: any, message?: string): void;
|
|
/**
|
|
* Check that the given javascript object is like the JSON-ified expected
|
|
* value. Useful for checking stringification and parsing of an object.
|
|
*/
|
|
notJsonOf(actual: any, expected: any, message?: string): void;
|
|
}
|
|
}
|
|
}
|
|
|
|
declare const chaiFuzzy: Chai.ChaiPlugin;
|
|
export = chaiFuzzy;
|
|
|