Files
DefinitelyTyped/types/load-json-file/load-json-file-tests.ts
2017-03-24 14:27:52 -07:00

16 lines
400 B
TypeScript

import * as loadJsonFile from 'load-json-file';
function assert(actual: string, expected: string): void {
if (actual !== expected) {
throw new Error(`${JSON.stringify(actual)} !== ${JSON.stringify(expected)}`);
}
}
loadJsonFile('../package.json').then(pkg => {
assert(pkg.name, 'definitely-typed');
});
const pkg = loadJsonFile.sync('../package.json');
assert(pkg.name, 'definitely-typed');