create new definitions for chai-html (#43688)

This commit is contained in:
Alexandre Djerbetian
2020-04-06 13:46:41 -07:00
committed by GitHub
parent c4bdf942b9
commit 0e4d35125d
4 changed files with 60 additions and 0 deletions
+11
View File
@@ -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('<div><img /></div>').html.to.equal('<div><img></div>');
expect('<h1>Hello World!</h1>').html.to.not.equal('<h1>Hallo Welt!</h1>');
expect('<div><!--Comment--></div>').html.ignoringComments.to.equal('<div></div>');
+25
View File
@@ -0,0 +1,25 @@
// Type definitions for chai-html 1.3
// Project: https://github.com/i-like-robots/chai-html
// Definitions by: Alex <https://github.com/adjerbetian>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
/// <reference types="chai" />
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;
+23
View File
@@ -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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }