Files
DefinitelyTyped/types/load-json-file/load-json-file-tests.ts

15 lines
399 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');