Description: replace ava by tape
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2022-09-20

--- a/test.js
+++ b/test.js
@@ -1,6 +1,6 @@
 import {promisify} from 'util';
 import fs from 'fs';
-import test from 'ava';
+import test from 'tape';
 
 // eslint-disable-next-line node/no-unsupported-features/es-syntax
 const importFresh = async modulePath => import(`${modulePath}?x=${new Date()}`);
@@ -9,14 +9,16 @@
 const writeFileP = promisify(fs.writeFile);
 
 delete process.env.npm_config_registry;
-test.afterEach(async () => {
+const afterEach = async () => {
 	try {
 		await unlinkP('.npmrc');
 	} catch {}
-});
+};
 
 test('get the npm registry URL globally', async t => {
-	t.truthy((await importFresh('./index.js')).default().length);
+	t.ok((await importFresh('./index.js')).default().length);
+	afterEach();
+	t.end();
 });
 
 test('works with npm_config_registry in the environment', async t => {
@@ -24,34 +26,46 @@
 	process.env.npm_config_registry = 'http://registry.example';
 	t.is((await importFresh('./index.js')).default(), 'http://registry.example/');
 	delete process.env.npm_config_registry;
+	afterEach();
+	t.end();
 });
 
 test('get the npm registry URL locally', async t => {
 	await writeFileP('.npmrc', 'registry=http://registry.npmjs.eu/');
 
 	t.is((await importFresh('./index.js')).default(), 'http://registry.npmjs.eu/');
+	afterEach();
+	t.end();
 });
 
 test('get local scope registry URL', async t => {
 	await writeFileP('.npmrc', '@myco:registry=http://reg.example.com/');
 
 	t.is((await importFresh('./index.js')).default('@myco'), 'http://reg.example.com/');
+	afterEach();
+	t.end();
 });
 
 test('return default npm registry when scope registry is not set', async t => {
 	await writeFileP('.npmrc', '');
 
 	t.is((await importFresh('./index.js')).default('@invalidScope'), 'https://registry.npmjs.org/');
+	afterEach();
+	t.end();
 });
 
 test('add trailing slash to local npm registry URL', async t => {
 	await writeFileP('.npmrc', 'registry=http://registry.npmjs.eu');
 
 	t.is((await importFresh('./index.js')).default(), 'http://registry.npmjs.eu/');
+	afterEach();
+	t.end();
 });
 
 test('add trailing slash to local scope registry URL', async t => {
 	await writeFileP('.npmrc', '@myco:registry=http://reg.example.com');
 
 	t.is((await importFresh('./index.js')).default('@myco'), 'http://reg.example.com/');
+	afterEach();
+	t.end();
 });
