From 09996ae894195f8ae74788ab1edaa09c5e38244a Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Tue, 26 Aug 2025 13:14:15 -0400 Subject: [PATCH 1/3] Remove pointless test --- test/labelSchema.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/labelSchema.js b/test/labelSchema.js index 26f480c..5abca67 100644 --- a/test/labelSchema.js +++ b/test/labelSchema.js @@ -4,14 +4,6 @@ const schemas = require('../labelSchema'); module.exports.tests = {}; -module.exports.tests.interface = function(test, common) { - test('interface', function(t) { - t.equal(typeof schemas, 'object', 'valid object'); - t.equal(schemas.hasOwnProperty('default'), true, 'has default defined'); - t.end(); - }); -}; - module.exports.tests.supported_countries = function(test, common) { test('supported countries', function(t) { const supported_countries = Object.keys(schemas); From e016a8f1a10ed13a99d0dcc0adc7d4e11df7e969 Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Tue, 26 Aug 2025 13:16:23 -0400 Subject: [PATCH 2/3] Make test intent clearer --- test/labelSchema.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/labelSchema.js b/test/labelSchema.js index 5abca67..38b608c 100644 --- a/test/labelSchema.js +++ b/test/labelSchema.js @@ -8,14 +8,14 @@ module.exports.tests.supported_countries = function(test, common) { test('supported countries', function(t) { const supported_countries = Object.keys(schemas); - t.notEquals(supported_countries.indexOf('USA'), -1); - t.notEquals(supported_countries.indexOf('CAN'), -1); - t.notEquals(supported_countries.indexOf('GBR'), -1); - t.notEquals(supported_countries.indexOf('AUS'), -1); - t.notEquals(supported_countries.indexOf('KOR'), -1); - t.notEquals(supported_countries.indexOf('FRA'), -1); - t.notEquals(supported_countries.indexOf('ITA'), -1); - t.notEquals(supported_countries.indexOf('default'), -1); + t.ok(supported_countries.includes('USA')); + t.ok(supported_countries.includes('CAN')); + t.ok(supported_countries.includes('GBR')); + t.ok(supported_countries.includes('AUS')); + t.ok(supported_countries.includes('KOR')); + t.ok(supported_countries.includes('FRA')); + t.ok(supported_countries.includes('ITA')); + t.ok(supported_countries.includes('default')); t.equals(Object.keys(schemas.USA.valueFunctions).length, 4); t.equals(Object.keys(schemas.CAN.valueFunctions).length, 3); From 55dc9a8b9a52da67ccff7caef4d0167175dccc9e Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Tue, 26 Aug 2025 13:16:50 -0400 Subject: [PATCH 3/3] Remove overspecification in tests These are just tests for arbitrary rule counts. Instead we should test actual behavior, and not care how many rules it takes to get there. These tests will just create extra work when changing code. --- test/labelSchema.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/test/labelSchema.js b/test/labelSchema.js index 38b608c..ae80164 100644 --- a/test/labelSchema.js +++ b/test/labelSchema.js @@ -17,18 +17,7 @@ module.exports.tests.supported_countries = function(test, common) { t.ok(supported_countries.includes('ITA')); t.ok(supported_countries.includes('default')); - t.equals(Object.keys(schemas.USA.valueFunctions).length, 4); - t.equals(Object.keys(schemas.CAN.valueFunctions).length, 3); - t.equals(Object.keys(schemas.GBR.valueFunctions).length, 3); - t.equals(Object.keys(schemas.AUS.valueFunctions).length, 3); - t.equals(Object.keys(schemas.KOR.valueFunctions).length, 3); - t.equals(Object.keys(schemas.FRA.valueFunctions).length, 2); - t.equals(Object.keys(schemas.ITA.valueFunctions).length, 3); - - t.equals(schemas.KOR.meta.separator, ' '); - t.end(); - }); };