How to use the jsonfile.setup function in jsonfile

To help you get started, we’ve selected a few jsonfile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kreuzerk / node-command-line-starter / src / file-access.spec.ts View on Github external
test('should log an error message if something went wrong', () => {
        const throwError = true;
        jsonfile.setup(throwError);

        sut.writeFile('../test', {});
        expect(chalk.red).toHaveBeenCalled();
    });
github kreuzerk / node-command-line-starter / src / file-access.spec.ts View on Github external
test('should log a success message if everything went well', () => {
        jsonfile.setup(false);

        sut.writeFile('../test', {});
        expect(chalk.green).toHaveBeenCalledWith(
            'Order successfully written to file'
        );
    });
});