From ab749c5b1886592b78db82af0ccca4c6ce18bc0d Mon Sep 17 00:00:00 2001 From: Ben Jervis Date: Fri, 26 Apr 2024 15:15:13 +1000 Subject: [PATCH] Try to make Windows happy about the tests --- packages/core/integration-tests/test/api.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/integration-tests/test/api.js b/packages/core/integration-tests/test/api.js index d64acfb4487..00d37bcacfd 100644 --- a/packages/core/integration-tests/test/api.js +++ b/packages/core/integration-tests/test/api.js @@ -62,7 +62,6 @@ describe('JS API', function () { describe('Reporter API', () => { it('should pass the parcel version to plugins', async () => { const dir = path.join(__dirname, 'plugin-parcel-version'); - const versionFileLocation = path.join(dir, 'parcel-version.txt'); overlayFS.mkdirp(dir); @@ -85,11 +84,12 @@ describe('JS API', function () { reporter-plugin.js: import {Reporter} from '@parcel/plugin'; + import path from 'node:path'; export default new Reporter({ async report({event, options}) { if (event.type === 'buildSuccess') { - await options.outputFS.writeFile("${versionFileLocation}", options.parcelVersion); + await options.outputFS.writeFile(path.join(options.projectRoot, 'parcel-version.txt'), options.parcelVersion); } } }) @@ -101,7 +101,7 @@ describe('JS API', function () { }); assert.equal( - await overlayFS.readFile(versionFileLocation), + await overlayFS.readFile(path.join(dir, 'parcel-version.txt')), PARCEL_VERSION, ); });