Skip to content

Commit

Permalink
chore: enforce filter must have same size
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny committed Oct 9, 2024
1 parent 4044e4f commit 00c6c3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/to/__tests__/toText.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { toText } from '../toText';
const analysis = new Analysis();
analysis.pushSpectrum({
x: {
data: [1, 2],
data: [1, 2, 3],
min: 1,
max: 2,
units: 'V',
label: 'voltage',
},
y: {
data: [3, 4],
data: [3, 4, 5],
min: 3,
max: 4,
units: 'mA',
Expand All @@ -32,15 +32,15 @@ describe('toCvs', () => {
it('all variables', () => {
const result = toText(analysis);
expect(result).toHaveLength(1);
expect(result[0]).toBe('voltage,current,seconds\n1,3,5\n2,4,6\n,,7');
expect(result[0]).toBe('voltage,current,seconds\n1,3,5\n2,4,6\n3,5,7');
});

it('select variables', () => {
const result = toText(analysis, {
selector: { xLabel: 'seconds', yLabel: 'voltage' },
});
expect(result).toHaveLength(1);
expect(result[0]).toBe('seconds,voltage\n5,1\n6,2\n7,');
expect(result[0]).toBe('seconds,voltage\n5,1\n6,2\n7,3');
});

it('empty analysis', () => {
Expand Down

0 comments on commit 00c6c3e

Please sign in to comment.