{"_id":"type-tester","_rev":"2-b9a979c3f3c2b1327f674c22ddc0f4f0","name":"type-tester","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"type-tester","version":"0.1.0","description":"A tester to check expected type errors","engines":{"node":">=6"},"main":"dist/index.js","dependencies":{},"peerDependencies":{"typescript":">=3.2.4"},"devDependencies":{"@mysticatea/eslint-plugin":"^8.0.1","@types/mocha":"^5.2.5","@types/node":"^10.12.18","codecov":"^3.1.0","eslint":"^5.12.1","mocha":"^5.2.0","nyc":"^13.1.0","opener":"^1.5.1","rimraf":"^2.6.3","ts-node":"^7.0.1","typescript":"^3.2.4"},"scripts":{"prebuild":"rimraf dist","build":"tsc -p esm.tsconfig.json && ts-node scripts/to-mjs && tsc -p cjs.tsconfig.json","clean":"rimraf .nyc_output coverage dist","codecov":"codecov","coverage":"nyc report --reporter lcov && opener coverage/lcov-report/index.html","lint":"eslint src test --ext .ts","pretest":"npm run -s lint","test":"nyc mocha test/*.ts","preversion":"npm test","version":"npm run -s build","postversion":"git push && git push --tags","watch":"mocha test/*.ts --require ts-node/register --watch-extensions ts --watch --growl"},"repository":{"type":"git","url":"git+https://github.com/mysticatea/type-tester.git"},"keywords":["test","type","typescript","mocha"],"author":{"name":"Toru Nagashima","url":"https://github.com/mysticatea"},"license":"MIT","bugs":{"url":"https://github.com/mysticatea/type-tester/issues"},"homepage":"https://github.com/mysticatea/type-tester#readme","gitHead":"d5d946fd83a3ad557a4c77d4fefba936c800aa3b","_id":"type-tester@0.1.0","_nodeVersion":"11.1.0","_npmVersion":"6.6.0","_npmUser":{"name":"mysticatea","email":"star.ctor@gmail.com"},"dist":{"integrity":"sha512-nJOQ5LQ5oouKvfhMiKQ4f/BuAZyJ3LkN2QpXA/WDCX9FDZmLhOwUC83SGNHZe7SRoyuupEvB/cZ4tYr82yWt7w==","shasum":"ade3f350e9614a82c874169471fda6aa7356b17a","tarball":"https://registry.npmjs.org/type-tester/-/type-tester-0.1.0.tgz","fileCount":8,"unpackedSize":31094,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRbvxCRA9TVsSAnZWagAAx0sP/3EXyGS2RdXNVxfUsL8v\nUZK2390gUnoLCIu1B9qkgjS6qzYNZ2cU5GlWj3wpTW+8OD+Vjm7ZTAva7/cB\nhej8+DxrnfX0lcctr7bynEUa/kwhPdB7iTQP8ZxpSQSl9IpxGybA05+pPRpR\n0LZuETOWxNSAnw82NF1TpoOJJVCdcn6cKeaSFuuVycUSr0Yhz7qwXggmKcIR\nz2cfZKdj6HMvZQ96g3sdy7J8URv5lnQK1aeQIixB477T9ha65ZRVoGDjVEZB\nEWimY3JhmbyfCKiB07miWnxlWCRodq40EAKGm9XSnSfSnmxpYGpxQ+a8ZgCI\nNvKme/rZHlhQifDpsc7XFn2P36yBG62To/cD9Bit8Dnh7sWinlmXkxsPLVFX\n25qe/QLXtlpDsxH1hnVDDX4Z1yJVpObPLtDBTqQdeA5NmKKe7Qm9MLHDhmeY\niwww8L6qS+wDKgrkNNsuRQ/bVu9DbSQ8DyVc9/vTRZFTV+MxU6haucvmJWQ9\nCsyHW62QiwxyJrK344zhhqrOSZFPeNlc4p5VlCN2F+DR/7EVWaBErP5/tLNc\nQ/84Sitmek12+QCk3+5NAfeQLSk3KBEyzg4rnnAEUEo1AF5B2sRJ1WIUBocg\nyUYddeZN6/sQxAZ3piRHEWKvuSWWAM3dfAwYV9pesU5wqMFSXLFvL4YXYUIj\nPKk8\r\n=WJEL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwHE9qZ6MAoNJp4qSnU4a0uBUu5WYGela16lv9z3WiEwIgLqwjzQQSTNcMcTpiPrH9nQrEfumyFwtygoIaqcd1rlk="}]},"maintainers":[{"name":"mysticatea","email":"star.ctor@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-tester_0.1.0_1548073969365_0.9638782799960666"},"_hasShrinkwrap":false},"1.0.0":{"name":"type-tester","version":"1.0.0","description":"A tester to check expected type errors","engines":{"node":">=6"},"main":"dist/index.js","dependencies":{},"peerDependencies":{"typescript":">=3.2.4"},"devDependencies":{"@mysticatea/eslint-plugin":"^8.0.1","@types/mocha":"^5.2.5","@types/node":"^10.12.18","codecov":"^3.1.0","eslint":"^5.12.1","mocha":"^5.2.0","nyc":"^13.1.0","opener":"^1.5.1","rimraf":"^2.6.3","ts-node":"^7.0.1","typescript":"^3.2.4"},"scripts":{"prebuild":"rimraf dist","build":"tsc -p esm.tsconfig.json && ts-node scripts/to-mjs && tsc -p cjs.tsconfig.json","clean":"rimraf .nyc_output coverage dist","codecov":"codecov","coverage":"nyc report --reporter lcov && opener coverage/lcov-report/index.html","lint":"eslint src test --ext .ts","pretest":"npm run -s lint","test":"nyc mocha test/*.ts","preversion":"npm test","version":"npm run -s build","postversion":"git push && git push --tags","watch":"mocha test/*.ts --require ts-node/register --watch-extensions ts --watch --growl"},"repository":{"type":"git","url":"git+https://github.com/mysticatea/type-tester.git"},"keywords":["test","type","typescript","mocha"],"author":{"name":"Toru Nagashima","url":"https://github.com/mysticatea"},"license":"MIT","bugs":{"url":"https://github.com/mysticatea/type-tester/issues"},"homepage":"https://github.com/mysticatea/type-tester#readme","gitHead":"8d2c84ff1fc22786f84cef49d31f88b7ba23896a","_id":"type-tester@1.0.0","_nodeVersion":"11.1.0","_npmVersion":"6.6.0","_npmUser":{"name":"mysticatea","email":"star.ctor@gmail.com"},"dist":{"integrity":"sha512-yAxZnjbrxIsy4+6qa6eJmAe+1r4Db5c6PpMGzSCBD5hn8Ow5y+EGO0+F9C+0GCq7UAYdzadndmJviNYLYtLXtQ==","shasum":"fbe8ff176218cbdf359bbbf4ed7c592571ed8e6a","tarball":"https://registry.npmjs.org/type-tester/-/type-tester-1.0.0.tgz","fileCount":8,"unpackedSize":31087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRb80CRA9TVsSAnZWagAAX1wQAIEOSEBKlk+MkigPlu63\nwh3XmcrDYYBzFooC0ZGQjVGbekQ4O2BkjJ3UE5X5oKw/xQvqFpfvsihODyaK\ngBhk/J/95NKbIcNAFjUrNSS/18sd1oadu/Sbd+slrpUCblRAaD4MPlTUp9A/\nttKMGj9bCAWb30oABSXPx4YTnQLaewP0CrJxiMXmnA/WoBzA1XFfnH4WlJxT\n95LbIsJ+aTE2j0+vJKxYqcSt9fcQ3OrG+CWcvO/+YlMVW2Fd0SQkxGg2cvuv\niBLrlOOVc65IgY95qwMqFIC5Q+Cqvsz7foFr+c/KixLOHVm7ZjZahBBk20au\n1jlRamn809BjOPqjgUA4y2FkfSPoB6xNQyIgndTTv7/WuIlRag9anhJhg+6e\nHvXbdcF/P5FWnF3Q8ND7BMgsjdkN7lbUeLeRcDgmhscDtyHIDyfoI5CVJuu4\n7DppPBK8ozXrEcql3as/gBapcr5vRTWCViyqdP7bX4pU9+EXl9fSXJu/K6XI\nwEIjGDFBK3s1R9qVnD/Kvj1jrCsUVB7KLynR68Q6WbiEml5TtYt7UPzGs/rr\n/DE2fLLIN2B4Oku/s5WoD9ehVLeQX+4mbTxw9XAk1oZKnhpI0THiz3nJ7gFU\nuQ3JbPIQVGOqtJzKSIxS+Da/yal0zh2lSbKC4bE9LSbNzhG4yyUMT95AjY7m\numkH\r\n=kp4n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB2X/RTjPC8w47+bUO3dCBjmoUk6WjUpB8y+3y7hvQRdAiBbgImmFqVOoJW/ThdozgEDq+8PA0RzL/QdBnCJJ3dwJA=="}]},"maintainers":[{"name":"mysticatea","email":"star.ctor@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/type-tester_1.0.0_1548074804249_0.9968053497207523"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-21T12:32:49.364Z","0.1.0":"2019-01-21T12:32:49.464Z","modified":"2022-05-22T12:20:11.819Z","1.0.0":"2019-01-21T12:46:44.366Z"},"maintainers":[{"name":"mysticatea","email":"star.ctor@gmail.com"}],"description":"A tester to check expected type errors","homepage":"https://github.com/mysticatea/type-tester#readme","keywords":["test","type","typescript","mocha"],"repository":{"type":"git","url":"git+https://github.com/mysticatea/type-tester.git"},"author":{"name":"Toru Nagashima","url":"https://github.com/mysticatea"},"bugs":{"url":"https://github.com/mysticatea/type-tester/issues"},"license":"MIT","readme":"# type-tester\n\n[![npm version](https://img.shields.io/npm/v/type-tester.svg)](https://www.npmjs.com/package/type-tester)\n[![Downloads/month](https://img.shields.io/npm/dm/type-tester.svg)](http://www.npmtrends.com/type-tester)\n[![Build Status](https://travis-ci.com/mysticatea/type-tester.svg?branch=master)](https://travis-ci.com/mysticatea/type-tester)\n[![Coverage Status](https://codecov.io/gh/mysticatea/type-tester/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/type-tester)\n[![Dependency Status](https://david-dm.org/mysticatea/type-tester.svg)](https://david-dm.org/mysticatea/type-tester)\n\nA tester to check expected type errors.\n\n## 🏁 Goal\n\nThis package provides utility to verify that the type you have written stricter reports expected type errors, for TypeScript.\n\n## 💿 Installation\n\nUse [npm] or a compatible tool to install this package.\n\n```\nnpm install type-tester typescript\n```\n\n- Requires Node.js `>=6.0.0`.\n\n## 📖 Usage\n\n1. Write fixture files.\n2. Write test files.\n3. Run test files with test runner such as [mocha].\n\n### 1. Write fixture files.\n\nThe fixture file should include the situation of type error.\nYou must add directive comments such as `// @expected 2345` for each line of expected errors.\nThe number is the error code of TypeScript.\n\nFor example: [test/fixtures/event-target-shim/fixture.ts](test/fixtures/event-target-shim/fixture.ts)\n\n### 2. Write test files.\n\nThe test file should execute `TypeTester#verify()` method with the path to the fixture files and compiler options.\n\nFor example: [test/example.ts](test/example.ts)\n\n### 3. Run test files with test runner such as [mocha].\n\nBecause the `TypeTester#verify()` method defines test cases with `describe` / `it` global functions, you must run it with test runners.\n\nFor example:\n\n```\nmocha test/example.ts --require ts-node/register\n\n  this test runs the type tester merely.\n    fixture.ts\n      √ should have an error TS2345 at L98.\n      √ should have an error TS2345 at L101.\n      √ should have an error TS7006 at L102.\n      √ should have an error TS2345 at L105.\n      √ should have an error TS7006 at L106.\n      √ should have an error TS2322 at L108.\n      √ should have an error TS2322 at L109.\n      √ should have an error TS2345 at L152.\n\n  8 passing (11ms)\n```\n\n## 📚 API References\n\n### `TypeTester` class\n\nThe class to verify expected type errors.\n\n### `constructor(ts: typeof import(\"typescript\"), options: TypeTester.Options)`\n\n#### Parameters\n\nName | Description\n:----|:-----------\n`ts` | API to use type checking.\n`options.describe` | Optional. Function to declare test suites. Use `global.describe` by default.\n`options.it` | Optional. Function to declare test cases. Use `global.it` by default.\n\n### `tester.verify(fixtureFiles: ReadonlyArray<string>, compilerOptions: ts.CompilerOptions): void`\n\nVerify the given fixture files.\n\n#### Parameters\n\nName | Description\n:----|:-----------\n`fixtureFiles` | Path to fixture files.\n`compilerOptions` | Compiler options to verify the fixture files.\n\n## 📰 Release notes\n\n- https://github.com/mysticatea/type-tester/releases\n\n## ❤️ Contributing\n\nContribution is welcome!\n\nPlease use GitHub issues and pull requests.\n\n### Development tools\n\n- `npm run build` generates files into `dist` directory.\n- `npm run clean` removes temporary files.\n- `npm run coverage` opens the coverage report the last `npm test` command generated.\n- `npm run lint` runs ESLint.\n- `npm test` runs tests.\n- `npm run watch` runs tests on each file edits.\n\n[mocha]: https://mochajs.org/\n[npm]: https://www.npmjs.com/\n","readmeFilename":"README.md"}