2
0
itizawa 5 жил өмнө
parent
commit
d797fbd7b2

+ 30 - 0
src/test/libs/to-array-from-csv.test.js

@@ -0,0 +1,30 @@
+const toArrayFromCsv = require('../../lib/util/toArrayFromCsv');
+
+describe('To array from csv', () => {
+
+  test('case 1', () => {
+    const result = toArrayFromCsv('dev,general');
+    expect(result).toStrictEqual(['dev', 'general']);
+  });
+
+  test('case 2', () => {
+    const result = toArrayFromCsv('dev');
+    expect(result).toStrictEqual(['dev']);
+  });
+
+  test('case 3', () => {
+    const result = toArrayFromCsv('');
+    expect(result).toStrictEqual(['']);
+  });
+
+  test('case 4', () => {
+    const result = toArrayFromCsv('dev, general');
+    expect(result).toStrictEqual(['dev', 'general']);
+  });
+
+  test('case 5', () => {
+    const result = toArrayFromCsv(',dev,general');
+    expect(result).toStrictEqual(['dev', 'general']);
+  });
+
+});

+ 0 - 20
src/test/libs/toAttayIfNot.test.js

@@ -1,20 +0,0 @@
-const toArrayFromCsv = require('@commons/util/to-array-from-csv');
-
-describe('Slack Util', () => {
-
-  test('post', () => {
-    const result = toArrayFromCsv('dev,general');
-    expect(result).toStrictEqual(['dev', 'general']);
-  });
-
-  test('post 2', () => {
-    const result = toArrayFromCsv('dev');
-    expect(result).toStrictEqual(['dev']);
-  });
-
-  test('post 3', () => {
-    const result = toArrayFromCsv('');
-    expect(result).toStrictEqual(['']);
-  });
-
-});