Skip to content

Commit

Permalink
fix: dynamically create tests based on available exports
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyfigaro committed Mar 30, 2024
1 parent 2db18ef commit 4de4b54
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { describe, it, expect } from 'bun:test';
import { ammos } from '../src';
import { describe, it, expect } from "bun:test";
import * as json from "../src";

describe('data exports', () => {
it('should include ammo', () => {
expect(ammos).toBeDefined();
describe("available JSON data", () => {
const availableKeys = Object.keys(json);

availableKeys.forEach((key) => {
it(`should include ${key}`, () => {
// @ts-expect-error
expect(json[key]).toBeDefined();
});
});
});

0 comments on commit 4de4b54

Please sign in to comment.