diff --git a/types/chai-html/chai-html-tests.ts b/types/chai-html/chai-html-tests.ts new file mode 100644 index 0000000000..be91102cad --- /dev/null +++ b/types/chai-html/chai-html-tests.ts @@ -0,0 +1,11 @@ +// tests taken from https://www.npmjs.com/package/chai-html + +import { use, expect } from 'chai'; +import * as chaiHtml from 'chai-html'; + +use(chaiHtml); + +expect('
').html.to.equal('
'); +expect('

Hello World!

').html.to.not.equal('

Hallo Welt!

'); + +expect('
').html.ignoringComments.to.equal('
'); diff --git a/types/chai-html/index.d.ts b/types/chai-html/index.d.ts new file mode 100644 index 0000000000..b11abb6f0d --- /dev/null +++ b/types/chai-html/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for chai-html 1.3 +// Project: https://github.com/i-like-robots/chai-html +// Definitions by: Alex +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/// + +declare global { + namespace Chai { + interface Assertion { + html: ChaiHtml.HtmlAssertion; + } + } +} + +declare namespace ChaiHtml { + interface HtmlAssertion extends Chai.Assertion { + ignoringComments: Chai.Assertion; + } +} + +declare const chaiHtml: Chai.ChaiPlugin; +declare namespace chaiHtml {} +export = chaiHtml; diff --git a/types/chai-html/tsconfig.json b/types/chai-html/tsconfig.json new file mode 100644 index 0000000000..e15ed842a4 --- /dev/null +++ b/types/chai-html/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", + "chai-html-tests.ts" + ] +} diff --git a/types/chai-html/tslint.json b/types/chai-html/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chai-html/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }