From 7617218a8530d7603cfed19a4163d9d336854965 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 28 Nov 2022 14:49:57 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Updating=20Docs=20[ci=20skip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/-__tests___customJestStubs-test.js.html | 167 ++++++++++++++++++ ..._SuiteScripts_Modules_aModule-test.js.html | 2 +- ..._SuiteScripts_Modules_bModule-test.js.html | 2 +- docs/customJestStubs.js.html | 29 +-- docs/index.html | 2 +- docs/jest.config.js.html | 2 +- docs/module-CustomJestStubs.html | 2 +- docs/module-JestConfig.html | 2 +- docs/module-aModule.html | 2 +- docs/module-bModule.html | 2 +- docs/module-customModule_CS-test.html | 48 ++++- ...stubs_SuiteScripts_Modules_aModule.js.html | 2 +- ...stubs_SuiteScripts_Modules_bModule.js.html | 2 +- docs/suitecloud.config.js.html | 2 +- 14 files changed, 241 insertions(+), 25 deletions(-) create mode 100644 docs/-__tests___customJestStubs-test.js.html diff --git a/docs/-__tests___customJestStubs-test.js.html b/docs/-__tests___customJestStubs-test.js.html new file mode 100644 index 0000000..8cc9421 --- /dev/null +++ b/docs/-__tests___customJestStubs-test.js.html @@ -0,0 +1,167 @@ + + + + + JSDoc: Source: __tests__/customJestStubs-test.js + + + + + + + + + + +
+ +

Source: __tests__/customJestStubs-test.js

+ + + + + + +
+
+
/**
+ * @format
+ * @module customModule_CS-test
+ */
+
+import customJestStubs from '../customJestStubs';
+
+beforeEach(() => {
+  jest.clearAllMocks();
+});
+// eslint-disable-next-line import/no-amd
+describe('customJestStubs.js Tests', () => {
+  describe('customStubs method should ', () => {
+    describe('ExcludeStubs param', () => {});
+    // * GIVEN
+    test('return an array when passed empty array', () => {
+      // * GIVEN
+      const ExcludeStubs = [];
+      // * WHEN
+      const CustomStubsList = customJestStubs.customStubs(ExcludeStubs);
+      // * THEN
+      expect(CustomStubsList).toEqual(expect.any(Array));
+      expect(jest.fn(() => CustomStubsList)).not.toThrow(Error);
+    });
+    test('throw an error if NOT given an array', () => {
+      // * GIVEN
+      const ExcludeStubs = {};
+      // * THEN
+      expect(jest.fn(() => customJestStubs.customStubs(ExcludeStubs))).toThrow(
+        'EXCLUDED_STUBS_TYPEERROR'
+      );
+    });
+    describe('useMinified is false', () => {
+      test('return array with excluded module path instead of stub path', () => {
+        // * GIVEN
+        const ExcludeStubs = [
+          {
+            name: '/SuiteScripts/Modules/aModule',
+            path: `<rootDir>/src/FileCabinet`,
+            useMinified: {
+              value: false,
+            },
+          },
+        ];
+        const ExpectedResult = [
+          {
+            module: '/SuiteScripts/Modules/aModule',
+            path: `<rootDir>/src/FileCabinet/SuiteScripts/Modules/aModule.js`,
+          },
+          {
+            module: '/SuiteScripts/Modules/aModule.min',
+            path: `<rootDir>/src/FileCabinet/SuiteScripts/Modules/aModule.js`,
+          },
+          {
+            module: '/SuiteScripts/Modules/bModule',
+            path: `<rootDir>/node_modules/@vnetwork-solutions/ns-custom-stubs-template/stubs/SuiteScripts/Modules/bModule`,
+          },
+          {
+            module: '/SuiteScripts/Modules/bModule.min',
+            path: `<rootDir>/node_modules/@vnetwork-solutions/ns-custom-stubs-template/stubs/SuiteScripts/Modules/bModule`,
+          },
+        ];
+        // * WHEN
+        const CustomStubsList = customJestStubs.customStubs(ExcludeStubs);
+        // * THEN
+        expect(CustomStubsList).toEqual(expect.arrayContaining(ExpectedResult));
+      });
+    });
+    describe('useMinified is true', () => {
+      /*   test.todo(
+        'should return array with minified excluded module path instead of stub path '
+      ); */
+      test('return array with excluded module path instead of stub path', () => {
+        // * GIVEN
+        const ExcludeStubs = [
+          {
+            name: '/SuiteScripts/Modules/aModule',
+            path: `<rootDir>/src/FileCabinet`,
+            useMinified: {
+              value: true,
+            },
+          },
+          {
+            name: '/SuiteScripts/Modules/bModule.min',
+            path: `<rootDir>/src/FileCabinet`,
+            useMinified: {
+              value: false,
+            },
+          },
+        ];
+        const ExpectedResult = [
+          {
+            module: '/SuiteScripts/Modules/aModule',
+            path: `<rootDir>/src/FileCabinet/SuiteScripts/Modules/aModule.js`,
+          },
+          {
+            module: '/SuiteScripts/Modules/aModule.min',
+            path: `<rootDir>/src/FileCabinet/SuiteScripts/Modules/aModule.min.js`,
+          },
+          {
+            module: '/SuiteScripts/Modules/bModule',
+            path: `<rootDir>/node_modules/@vnetwork-solutions/ns-custom-stubs-template/stubs/SuiteScripts/Modules/bModule`,
+          },
+          {
+            module: '/SuiteScripts/Modules/bModule.min',
+            path: `<rootDir>/src/FileCabinet/SuiteScripts/Modules/bModule.js`,
+          },
+        ];
+        // * WHEN
+        const CustomStubsList = customJestStubs.customStubs(ExcludeStubs);
+        // * THEN
+        expect(CustomStubsList).toEqual(expect.arrayContaining(ExpectedResult));
+      });
+    });
+  });
+});
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/docs/-__tests___stubs_SuiteScripts_Modules_aModule-test.js.html b/docs/-__tests___stubs_SuiteScripts_Modules_aModule-test.js.html index 8416c89..25a02c5 100644 --- a/docs/-__tests___stubs_SuiteScripts_Modules_aModule-test.js.html +++ b/docs/-__tests___stubs_SuiteScripts_Modules_aModule-test.js.html @@ -104,7 +104,7 @@

Home

Modules