@@ -89,14 +89,8 @@ test('ensure that instanceof works accross different installations of the fastif
8989 const { createError, FastifyError } = require('fastify-error')
9090 const { foo } = require('dep')
9191
92- function normalizePath (filePath) {
93- filePath = path.normalize(filePath)
94- filePath = filePath.slice(filePath.lastIndexOf('${ testDirectoryPrefix } ') + 1)
95- return filePath
96- }
97-
98- const actualPathOfFastifyError = normalizePath(require.resolve('fastify-error'))
99- const expectedPathOfFastifyError = normalizePath(path.resolve('${ testCwd } ', 'node_modules', 'fastify-error', 'index.js'))
92+ const actualPathOfFastifyError = require.resolve('fastify-error')
93+ const expectedPathOfFastifyError = path.resolve('node_modules', 'fastify-error', 'index.js')
10094
10195 // Ensure that fastify-error is required from the node_modules directory of the test-project
10296 if (actualPathOfFastifyError !== expectedPathOfFastifyError) {
@@ -139,14 +133,8 @@ test('ensure that instanceof works accross different installations of the fastif
139133 const path = require('node:path')
140134 const { createError } = require('fastify-error')
141135
142- function normalizePath (filePath) {
143- filePath = path.normalize(filePath)
144- filePath = filePath.slice(filePath.lastIndexOf('${ testDirectoryPrefix } ') + 1)
145- return filePath
146- }
147-
148- const actualPathOfFastifyError = normalizePath(require.resolve('fastify-error'))
149- const expectedPathOfFastifyError = normalizePath(path.resolve('${ testCwd } ','node_modules', 'dep', 'node_modules', 'fastify-error', 'index.js'))
136+ const actualPathOfFastifyError = require.resolve('fastify-error')
137+ const expectedPathOfFastifyError = path.resolve('node_modules', 'dep', 'node_modules', 'fastify-error', 'index.js')
150138
151139 // Ensure that fastify-error is required from the node_modules directory of the test-project
152140 if (actualPathOfFastifyError !== expectedPathOfFastifyError) {
0 commit comments