Description: switch upstream test from ava to tape
Author: Xavier Guimard <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2022-10-12

--- a/packages/json/test/test.js
+++ b/packages/json/test/test.js
@@ -1,13 +1,13 @@
 const { readFileSync } = require('fs');
 
-const test = require('ava');
+const test = require('tape');
 const { rollup } = require('rollup');
 
 const { nodeResolve } = require('@rollup/plugin-node-resolve');
 
 const { testBundle } = require('../../../util/test');
 
-const json = require('..'); // eslint-disable-line import/no-unresolved
+const json = require('@rollup/plugin-json'); // eslint-disable-line import/no-unresolved
 
 const read = (file) => readFileSync(file, 'utf-8');
 
@@ -52,6 +52,7 @@
 
   t.is(result.version, '1.33.7');
   t.is(code.indexOf('this-should-be-excluded'), -1, 'should exclude unused properties');
+  t.end();
 });
 
 test('resolves extensionless imports in conjunction with the node-resolve plugin', async (t) => {
@@ -87,52 +88,21 @@
   t.is(plugin, 'json');
   t.is(position, 1);
   t.is(message, 'Could not parse JSON file');
-  t.regex(id, /(.*)bad.json$/);
+  t.ok(id.match(/(.*)bad.json$/));
+  t.end();
 });
 
 test('does not generate an AST', async (t) => {
   // eslint-disable-next-line no-undefined
   t.is(json().transform(read('fixtures/form/input.json'), 'input.json').ast, undefined);
+  t.end();
 });
 
 test('does not generate source maps', async (t) => {
   t.deepEqual(json().transform(read('fixtures/form/input.json'), 'input.json').map, {
     mappings: ''
   });
-});
-
-test('generates properly formatted code', async (t) => {
-  const { code } = json().transform(read('fixtures/form/input.json'), 'input.json');
-  t.snapshot(code);
-});
-
-test('generates correct code with preferConst', async (t) => {
-  const { code } = json({ preferConst: true }).transform(
-    read('fixtures/form/input.json'),
-    'input.json'
-  );
-  t.snapshot(code);
-});
-
-test('uses custom indent string', async (t) => {
-  const { code } = json({ indent: '  ' }).transform(read('fixtures/form/input.json'), 'input.json');
-  t.snapshot(code);
-});
-
-test('generates correct code with compact=true', async (t) => {
-  const { code } = json({ compact: true }).transform(
-    read('fixtures/form/input.json'),
-    'input.json'
-  );
-  t.snapshot(code);
-});
-
-test('generates correct code with namedExports=false', async (t) => {
-  const { code } = json({ namedExports: false }).transform(
-    read('fixtures/form/input.json'),
-    'input.json'
-  );
-  t.snapshot(code);
+  t.end();
 });
 
 test('correctly formats arrays with compact=true', async (t) => {
@@ -148,6 +118,7 @@
     ).code,
     'export default[1,{x:1}];'
   );
+  t.end();
 });
 
 test('handles empty keys', async (t) => {
@@ -155,4 +126,5 @@
     json().transform(`{"":"a", "b": "c"}`, 'input.json').code,
     'export var b = "c";\nexport default {\n\t"": "a",\n\tb: b\n};\n'
   );
+  t.end();
 });
