peaks-similarity
Version:
Peaks similarity - calculate the similarity between 2 ordered arrays of peaks
88 lines (81 loc) • 1.29 kB
JavaScript
import { test, expect } from 'vitest';
import { getCommonArray } from '../getCommonArray.js';
test('Test 1', () => {
const result = getCommonArray(
[
[],
[],
],
[
[],
[],
],
0.2,
);
expect(result).toStrictEqual([
[],
[],
]);
});
test('Test 2', () => {
const result = getCommonArray(
[
[],
[],
],
[
[],
[],
],
0.2,
);
expect(result).toStrictEqual([
[],
[],
]);
});
test('Test 3', () => {
const result = getCommonArray(
[
[],
[],
],
[
[],
[],
],
0.2,
);
expect(result).toStrictEqual([
[],
[],
]);
});
test('Test 4', () => {
const result = getCommonArray(
[
[],
[],
],
[
[],
[],
],
0.2,
);
expect(result).toStrictEqual([[1], [2]]);
});
test('Test 5', () => {
const result = getCommonArray(
[
[],
[],
],
[[1, 2]],
0.2,
);
expect(result).toStrictEqual([
[],
[],
]);
});