From bb60f4a4d5b8e24bc3fa90cd7fb1b9d4f2fa2fd5 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Sun, 14 Jun 2026 22:39:36 +0300 Subject: [PATCH] chore: remove orphaned test-node package --- packages/test-node/index.test.ts | 73 -------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 packages/test-node/index.test.ts diff --git a/packages/test-node/index.test.ts b/packages/test-node/index.test.ts deleted file mode 100644 index 0994693..0000000 --- a/packages/test-node/index.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -// biome-ignore-all lint/performance/noDynamicNamespaceImportAccess: test file - -import { describe, expect, test } from 'bun:test' -import fs from 'node:fs' -import path from 'node:path' - -import * as mjs from '../../dist/mjs/index.js' -import * as source from '../countries/src/index.ts' - -const distDir = path.resolve(import.meta.dir, '../../dist') - -const exportDataList: Partial[] = ['continents', 'countries', 'languages'] -const exportFnList: Partial[] = ['getEmojiFlag'] - -function evalIIFE(name = 'Countries') { - const script = fs.readFileSync(path.join(distDir, 'index.iife.js'), { encoding: 'utf-8' }) - // biome-ignore lint/security/noGlobalEval: - - eval(`this.${name} = (function () { ${script}\nreturn ${name}})()`) -} - -describe('dist', () => { - test('has proper CJS ES6 export', () => { - expect(typeof mjs).toBe('object') - - for (const prop of exportFnList) { - expect(Object.hasOwn(mjs, prop)).toBe(true) - } - - for (const prop of exportDataList) { - expect(Object.hasOwn(mjs, prop)).toBe(true) - - const cjsKeys = Object.keys(mjs[prop]) - const srcKeys = Object.keys(source[prop]) - expect(cjsKeys).toEqual(srcKeys) - } - }) - - test('all English country names should contain only A-Z characters', () => { - const nameReg = /^[a-z\s.()-]+$/i - const nonAZ: string[] = [] - for (const c of Object.values(source.countries)) { - if (!nameReg.test(c.name)) { - nonAZ.push(c.name) - } - } - - // It helps see incorrect names right away in logs - expect(nonAZ).toEqual([]) - }) - - test('loads ES6