diff --git a/src/index.spec.ts b/src/index.spec.ts deleted file mode 100644 index 5726046..0000000 --- a/src/index.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { expect, describe, it } from 'vitest' - -import { parse } from './index.js' - -describe('specification of CEL', () => { - describe('addition', () => { - it('should parse addition', () => { - const expr = '1 + 1' - - const result = parse(expr) - - expect(result).toBe(2) - }) - - it('should parse addition with multiple terms', () => { - const expr = '1 + 1 + 1' - - const result = parse(expr) - - expect(result).toBe(3) - }) - - it('should parse addition with multiple terms with different signs', () => { - const expr = '1 + 1 - 1' - - const result = parse(expr) - - expect(result).toBe(1) - }) - }) -}) diff --git a/src/spec/atomic-expression.spec.ts b/src/spec/atomic-expression.spec.ts new file mode 100644 index 0000000..f25e761 --- /dev/null +++ b/src/spec/atomic-expression.spec.ts @@ -0,0 +1,13 @@ +import { expect, describe, it } from 'vitest' + +import { parse } from '..' + +describe('atomic expressions', () => { + it('should parse a number', () => { + const expr = '1' + + const result = parse(expr) + + expect(result).toBe(1) + }) +})