GetValue should no longer throw an exception if an error code is returned

This was causing issues with JavaScript execution stopping on the exception, preventing further processing in the module. This was especially an issue when the module was trying to get a value that it should have been providing in the first place (looking at you SkillSoft)
This commit is contained in:
Jonathan Putney
2021-05-27 09:11:02 -04:00
parent ef81884a3b
commit 954768ec61
3 changed files with 27 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Mocha Unit Tests" type="mocha-javascript-test-runner">
<node-interpreter>project</node-interpreter>
<node-options />
<mocha-package>$PROJECT_DIR$/node_modules/mocha</mocha-package>
<working-directory>$PROJECT_DIR$</working-directory>
<pass-parent-env>true</pass-parent-env>
<ui>bdd</ui>
<extra-mocha-options>--watch --require @babel/register</extra-mocha-options>
<test-kind>PATTERN</test-kind>
<test-pattern>test/**/*.spec.js</test-pattern>
<method v="2" />
</configuration>
</component>

12
.run/compile.run.xml Normal file
View File

@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="compile" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="compile" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>

View File

@@ -71,7 +71,7 @@ export const checkLMSGetValue = (
initializeFirst = false,
initializationValue = '',
expectedError = 0,
errorThrown = true,
errorThrown = false,
}) => {
describe(`Field: ${fieldName}`, () => {
const status = expectedError > 0 ? 'fail to' : 'successfully';