From 706e675fe41a42c9332c7c48d7bd4da354e5d536 Mon Sep 17 00:00:00 2001 From: Nils Knappmeier Date: Wed, 17 Jul 2024 00:05:13 +0200 Subject: [PATCH] Revert "chore: fix CI for Windows" This reverts commit 396ef276d7ffda280cfc33408bc4fac07af5509d. --- handlebars/helpers/dirTree.js | 2 +- test/fixtures/shout.js | 4 +--- test/resolve-package-root-spec.js | 17 ++++++----------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/handlebars/helpers/dirTree.js b/handlebars/helpers/dirTree.js index 97c183c..90cd7ed 100644 --- a/handlebars/helpers/dirTree.js +++ b/handlebars/helpers/dirTree.js @@ -4,7 +4,7 @@ const _ = { const pify = require('pify') const glob = pify(require('glob')) const debug = require('debug')('thought:helpers') -const path = require('path').posix +const path = require('path') module.exports = dirTree diff --git a/test/fixtures/shout.js b/test/fixtures/shout.js index cdb0f41..0bfe729 100644 --- a/test/fixtures/shout.js +++ b/test/fixtures/shout.js @@ -1,4 +1,2 @@ // Output the path of this script relative to the cwd (for the exec-helper-test -const path = require('path').posix; -const myRelativePath = path.relative(process.cwd(), __filename); -console.log(myRelativePath.toUpperCase()) +console.log(require('path').relative(process.cwd(), __filename).toUpperCase()) diff --git a/test/resolve-package-root-spec.js b/test/resolve-package-root-spec.js index 3676de1..5c3757f 100644 --- a/test/resolve-package-root-spec.js +++ b/test/resolve-package-root-spec.js @@ -14,11 +14,6 @@ chai.use(require('chai-as-promised')) chai.use(require('dirty-chai')) const expect = chai.expect const { resolvePackageRoot } = require('../lib/utils/resolve-package-root') -const path = require('path') - -function osIndependent(somePath) { - return somePath.replace(/\//g, path.sep) -} describe('The "resolve-package-root" utility', function () { let statSync @@ -32,18 +27,18 @@ describe('The "resolve-package-root" utility', function () { fs.statSync = statSync }) - it('finds a package.json file and provide the relative path of the given file', function () { + it('find a package.json file and provide the relative path of the given file', function () { return expect(resolvePackageRoot('test/fixtures/mini-project/a/b/test.txt')).to.eventually.deep.equal({ - packageRoot: osIndependent('test/fixtures/mini-project'), - relativeFile: osIndependent('a/b/test.txt'), + packageRoot: 'test/fixtures/mini-project', + relativeFile: 'a/b/test.txt', packageJson: { name: 'mini-project', version: '1.0.0' } }) }) - it('is not be bothered by directory named "package.json"', function () { + it('find not be bothered by directory named "package.json"', function () { return expect(resolvePackageRoot('test/fixtures/mini-project/a/b/package.json/test.txt')).to.eventually.deep.equal({ - packageRoot: osIndependent('test/fixtures/mini-project'), - relativeFile: osIndependent('a/b/package.json/test.txt'), + packageRoot: 'test/fixtures/mini-project', + relativeFile: 'a/b/package.json/test.txt', packageJson: { name: 'mini-project', version: '1.0.0' } }) })