Wearables Comparison Source Code

Browse the implementation files for Wearables Comparison.
search.spec.ts typescript
import { describe, expect, it } from 'vitest';

import { matchesCatalogQuery } from './search';

describe('catalog comparison search matching', () => {
	it('matches names, slugs, and small typing mistakes', () => {
		expect(
			matchesCatalogQuery('sirius', ['Sirius', 'sirius'])
		).toBe(true);
		expect(
			matchesCatalogQuery('siruis', ['Sirius', 'sirius'])
		).toBe(true);
		expect(
			matchesCatalogQuery('galaxy', [
				'Samsung Galaxy S26',
				'samsung-galaxy-s26'
			])
		).toBe(true);
	});

	it('does not make very short searches fuzzy', () => {
		expect(matchesCatalogQuery('bla', ['Blueberry'])).toBe(
			false
		);
	});
});

Description

Browse the implementation files for Wearables Comparison.

References

  1. Tool.io on GitHub
  2. Tool.io TypeScript tools library

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies