Skip to content

Commit

Permalink
test(index): add test for TS declaration file
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Nov 7, 2019
1 parent c6e8a54 commit b029a4b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
16 changes: 16 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import StyleToObject = require('style-to-object');

// $ExpectType { [name: string]: string; } | null
StyleToObject('color: red');

// $ExpectError
StyleToObject();

// $ExpectError
StyleToObject(null);

// $ExpectError
StyleToObject(42);

// $ExpectError
StyleToObject(true);
11 changes: 8 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"compilerOptions": {
"module": "umd",
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noEmit": true
}
"baseUrl": ".",
"noEmit": true,
"paths": {
"style-to-object": ["."]
}
},
"files": ["index.d.ts", "test/index.test.ts"]
}

0 comments on commit b029a4b

Please sign in to comment.