From 44b8d678bf2436cc541a2dcf437d730441e38da6 Mon Sep 17 00:00:00 2001 From: Brandon Ramirez Date: Thu, 2 May 2024 19:08:13 -0500 Subject: [PATCH] Write test file directly because grunt keeps getting EEXIST errors from mkdir. --- test/unit-tests.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/unit-tests.js b/test/unit-tests.js index 2d7f2ea..332ae96 100644 --- a/test/unit-tests.js +++ b/test/unit-tests.js @@ -1,3 +1,4 @@ +const fs = require('fs'); const grunt = require('grunt'); const jsonlint = require('@prantlf/jsonlint'); const validator = require('@prantlf/jsonlint/lib/validator'); @@ -265,7 +266,7 @@ function testReformattingFile(indent) { } // Build an unformatted file for testing. - grunt.file.write(`${__dirname}/reformat-this.json`, '{"somethingsomething":"something","something":"dark side"}'); + fs.writeFileSync(`${__dirname}/reformat-this.json`, '{"somethingsomething":"something","something":"dark side"}', { encoding: 'utf8' }); runWithFiles(grunt, jsonlint, [ 'test/reformat-this.json' ], options);