Files
insomnia/packages/insomnia-data/__tests__/index.test.ts
Bingbing b09cde814d refactor: extract insomnia-data into workspace package (#10010)
Move insomnia-data models, services, database code, and common utilities into a dedicated workspace package. Update consumers to import from the new package entrypoints and declare workspace dependencies for the extracted package.
2026-06-02 09:49:10 +00:00

29 lines
798 B
TypeScript

import { models } from 'insomnia-data';
import { describe, expect, it } from 'vitest';
const { getModel, mustGetModel } = models;
describe('index', () => {
describe('getModel()', () => {
it('should get model if found', () => {
expect(getModel(models.workspace.type)).not.toBeNull();
});
it('should return null if model not found', () => {
expect(getModel('UNKNOWN')).toBeNull();
});
});
describe('mustGetModel()', () => {
it('should get model if found', () => {
expect(mustGetModel(models.workspace.type)).not.toBeNull();
});
it('should return null if model not found', () => {
const func = () => mustGetModel('UNKNOWN');
expect(func).toThrowError('The model type UNKNOWN must exist but could not be found.');
});
});
});