From 80c90ebda151922e371f5b40e2e350d771255156 Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Mon, 26 Dec 2022 22:44:32 +0500 Subject: [PATCH] chore: add specs --- src/rules/line/noGremlins.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/rules/line/noGremlins.spec.ts diff --git a/src/rules/line/noGremlins.spec.ts b/src/rules/line/noGremlins.spec.ts new file mode 100644 index 0000000..6f60703 --- /dev/null +++ b/src/rules/line/noGremlins.spec.ts @@ -0,0 +1,15 @@ +import { Severity } from '../../types/Severity' +import { noGremlins } from './noGremlins' + +describe('noTabs', () => { + it('should return an empty array when the line does not have any gremlin', () => { + const line = "%put 'hello';" + expect(noGremlins.test(line, 1)).toEqual([]) + }) + + it('should return a diagnostic array when the line contains gremlins', () => { + const line = "– ‘ %put 'hello';" + const diagnostics = noGremlins.test(line, 1) + expect(diagnostics.length).toEqual(2) + }) +})