diff --git a/builder/policy/test/index.ts b/builder/policy/test/index.ts index d4f6f0b5e1..53467b9a98 100644 --- a/builder/policy/test/index.ts +++ b/builder/policy/test/index.ts @@ -32,7 +32,7 @@ it('should not allow patterns in onlyBuiltDependencies', () => { it('should onlyBuiltDependencies set via a file', () => { const allowBuild = createAllowBuildFunction({ - onlyBuiltDependenciesFile: path.join(__dirname, 'onlyBuild.json'), + onlyBuiltDependenciesFile: path.join(import.meta.dirname, 'onlyBuild.json'), }) expect(typeof allowBuild).toBe('function') expect(allowBuild!('zoo', '1.0.0')).toBeTruthy() @@ -43,7 +43,7 @@ it('should onlyBuiltDependencies set via a file', () => { it('should onlyBuiltDependencies set via a file and config', () => { const allowBuild = createAllowBuildFunction({ onlyBuiltDependencies: ['bar'], - onlyBuiltDependenciesFile: path.join(__dirname, 'onlyBuild.json'), + onlyBuiltDependenciesFile: path.join(import.meta.dirname, 'onlyBuild.json'), }) expect(typeof allowBuild).toBe('function') expect(allowBuild!('zoo', '1.0.0')).toBeTruthy()