We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b4c314 commit c727682Copy full SHA for c727682
src/haystack.test.ts
@@ -0,0 +1,18 @@
1
+import { isRef, parseRef } from 'haystack';
2
+
3
+// Just a stub test
4
+describe('haystack test', () => {
5
+ it('isRef', () => {
6
+ expect(isRef('@abc')).toBe(true);
7
+ expect(isRef('@abc 123')).toBe(true);
8
+ expect(isRef('@abc 123 abc')).toBe(true);
9
+ expect(isRef('abc 123')).toBe(false);
10
+ expect(isRef('abc @123')).toBe(false);
11
+ });
12
13
+ it('parseRef', () => {
14
+ expect(parseRef('@abc')).toStrictEqual({ id: '@abc', dis: null });
15
+ expect(parseRef('@abc "123"')).toStrictEqual({ id: '@abc', dis: '123' });
16
+ expect(parseRef('@abc "123 abc"')).toStrictEqual({ id: '@abc', dis: '123 abc' });
17
18
+});
src/module.test.ts
0 commit comments