New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

declaration-syntax-tester

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

declaration-syntax-tester

A simple syntax testing tool for Typescript declaration development

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
1
-80%
Maintainers
1
Weekly downloads
 
Created
Source

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

  • typings-d3

Keywords

typescript

FAQs

Package last updated on 17 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts