Skip to content

Commit

Permalink
📝 Updating Docs [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 28, 2022
1 parent 18d790a commit 7617218
Show file tree
Hide file tree
Showing 14 changed files with 241 additions and 25 deletions.
167 changes: 167 additions & 0 deletions docs/-__tests___customJestStubs-test.js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: __tests__/customJestStubs-test.js</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

<h1 class="page-title">Source: __tests__/customJestStubs-test.js</h1>






<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* @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: `&lt;rootDir>/src/FileCabinet`,
useMinified: {
value: false,
},
},
];
const ExpectedResult = [
{
module: '/SuiteScripts/Modules/aModule',
path: `&lt;rootDir>/src/FileCabinet/SuiteScripts/Modules/aModule.js`,
},
{
module: '/SuiteScripts/Modules/aModule.min',
path: `&lt;rootDir>/src/FileCabinet/SuiteScripts/Modules/aModule.js`,
},
{
module: '/SuiteScripts/Modules/bModule',
path: `&lt;rootDir>/node_modules/@vnetwork-solutions/ns-custom-stubs-template/stubs/SuiteScripts/Modules/bModule`,
},
{
module: '/SuiteScripts/Modules/bModule.min',
path: `&lt;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: `&lt;rootDir>/src/FileCabinet`,
useMinified: {
value: true,
},
},
{
name: '/SuiteScripts/Modules/bModule.min',
path: `&lt;rootDir>/src/FileCabinet`,
useMinified: {
value: false,
},
},
];
const ExpectedResult = [
{
module: '/SuiteScripts/Modules/aModule',
path: `&lt;rootDir>/src/FileCabinet/SuiteScripts/Modules/aModule.js`,
},
{
module: '/SuiteScripts/Modules/aModule.min',
path: `&lt;rootDir>/src/FileCabinet/SuiteScripts/Modules/aModule.min.js`,
},
{
module: '/SuiteScripts/Modules/bModule',
path: `&lt;rootDir>/node_modules/@vnetwork-solutions/ns-custom-stubs-template/stubs/SuiteScripts/Modules/bModule`,
},
{
module: '/SuiteScripts/Modules/bModule.min',
path: `&lt;rootDir>/src/FileCabinet/SuiteScripts/Modules/bModule.js`,
},
];
// * WHEN
const CustomStubsList = customJestStubs.customStubs(ExcludeStubs);
// * THEN
expect(CustomStubsList).toEqual(expect.arrayContaining(ExpectedResult));
});
});
});
});
</code></pre>
</article>
</section>




</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aModule.html">aModule</a></li><li><a href="module-bModule.html">bModule</a></li><li><a href="module-CustomJestStubs.html">CustomJestStubs</a></li><li><a href="module-customModule_CS-test.html">customModule_CS-test</a></li><li><a href="module-JestConfig.html">JestConfig</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
29 changes: 16 additions & 13 deletions docs/customJestStubs.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ <h1 class="page-title">Source: customJestStubs.js</h1>
*/
const customStubs = exclude =>
Object.keys(CustomStubMap).map(filename => {
if (!Array.isArray(exclude)) throw 'EXCLUDED_STUBS_TYPEERROR';
let stubModuleName = `/SuiteScripts/${filename}`;
let ext = '.js';
const Module = {
Expand All @@ -101,22 +102,13 @@ <h1 class="page-title">Source: customJestStubs.js</h1>
};
// Loop over array of excludes and link min/non-min to project overrides
for (const ExcludedModule of exclude) {
if (RegExp(ExcludedModule.name).test(filename)) continue; //?
if (!RegExp(ExcludedModule.name).test(stubModuleName)) continue; //?
ExcludedModule.useMinified.minName =
ExcludedModule.useMinified.hasOwnProperty('minName')
? ExcludedModule.useMinified.minName
: '.min';
const ModuleNameMinified = `${ExcludedModule.name}${ExcludedModule.useMinified.minName}`;
if (
ExcludedModule.name !== stubModuleName &amp;&amp;
ModuleNameMinified !== stubModuleName
)
continue;
if (ExcludedModule.useMinified.value) {
Module.path = ExcludedModule.path.replace(
ExcludedModule.useMinified.minName,
''
);
Module.path = ExcludedModule.path + stubModuleName + ext;
break;
}
stubModuleName = stubModuleName.replace(
Expand All @@ -128,7 +120,18 @@ <h1 class="page-title">Source: customJestStubs.js</h1>
}
return Module;
});

/*
const ExcludeStubs = [
{
name: '/SuiteScripts/Modules/aModule',
path: `${__dirname}/src/FileCabinet`,
useMinified: {
value: false,
},
},
];
customStubs(ExcludeStubs); //?
*/
module.exports = {
customStubs,
};
Expand All @@ -148,7 +151,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/jest.config.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-CustomJestStubs.html
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-JestConfig.html
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-aModule.html
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-bModule.html
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
48 changes: 47 additions & 1 deletion docs/module-customModule_CS-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,52 @@ <h1 class="page-title">Module: customModule_CS-test</h1>



</article>

</section>







<section>

<header>



</header>

<article>
<div class="container-overview">





</div>




















</article>

</section>
Expand All @@ -122,7 +168,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/stubs_SuiteScripts_Modules_aModule.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/stubs_SuiteScripts_Modules_bModule.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/suitecloud.config.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-aM
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 03:25:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Mon Nov 28 2022 14:49:55 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down

0 comments on commit 7617218

Please sign in to comment.