0.1.2 • Published 8 years ago

declaration-syntax-tester v0.1.2

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

Install

npm install declaration-syntax-tester --save-dev

Using with tape

const test = require('tape');
const {accept, reject} = require('declaration-syntax-tester')();

test('sample...', t => {
  // Write test case for accepted syntax of declaration files
  t.error(accept(`
    import sample from '../sample';
    const x:number = sample.getNumber();
  `), 'should getNumber() return number.');

  // Write test case for rejected syntax of declaration files
  t.error(reject(`
    import sample from '../sample';
    const x:string = sample.getNumber();
  `), 'should return value of getNumber() can not assign to string.');
})

A sample project

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.30

8 years ago

0.0.1

8 years ago