Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045019Retail ModulesWeb POSpublic2020-09-09 16:192021-02-19 07:16
alostale 
Retail 
normalmajorhave not tried
closedout of date 
5
 
 
No
0045019: run jest tests in strict mode
Jest tests should be run in strict mode. This would prevent at least two kind of problems (see 0044752 and 0045016):

* usage of global scope objects
* mutating frozen objects
-
It is possible to run in this way through node parameter. To check if it can be enforced somehow to be run through "npm test". If not possible, we could at least run in this mode in CI.

node --use_strict node_modules/.bin/jest

No tags attached.
related to defect 0044752 closed alostale Retail Modules do not use global scope in jest tests 
related to defect 0045016 closed Retail Retail Modules state actions mutate objects 
related to defect 0045796 new Retail Retail Modules Some jest tests were disabled in the org.openbravo.retail.asyncpayprovider module 
depends on defect 0045814 closed ranjith_qualiantech_com Retail Modules jest test in nexoprovider fail with --strict-mode 
related to defect 0045751 closed ranjith_qualiantech_com Retail Modules jest tests in org.openbravo.retail.asyncpayprovider module does not work in jest script mode (i.e. in context of pos2) 
related to defect 0045750 closed ranjith_qualiantech_com Retail Modules do not use global scope in jest tests (fix new cases) 
related to defect 0045820 new Retail Retail Modules Two jest tests have been disabled in Nexo provider as they imported enyo and could not be run in strict mode 
related to feature request 0045846 closed alostale Openbravo ERP prepare infrastructure to support react applications 
Issue History
2020-09-09 16:19alostaleNew Issue
2020-09-09 16:19alostaleAssigned To => Retail
2020-09-09 16:19alostaleTriggers an Emergency Pack => No
2020-09-09 16:19alostaleRelationship addedrelated to 0044752
2020-09-09 16:19alostaleRelationship addedrelated to 0045016
2021-01-19 12:52shuehnerIssue Monitored: shuehner
2021-01-19 12:54shuehnerRelationship addedrelated to 0045751
2021-01-19 12:55shuehnerRelationship addedrelated to 0045750
2021-01-29 13:10shuehnerRelationship addedrelated to 0045796
2021-01-29 13:13shuehnerRelationship addeddepends on 0045814
2021-02-01 07:13marvintmRelationship addedrelated to 0045820
2021-02-04 11:57alostaleRelationship addedrelated to 0045846
2021-02-19 06:44hgbotNote Added: 0126175
2021-02-19 07:16alostaleNote Added: 0126177
2021-02-19 07:16alostaleStatusnew => closed
2021-02-19 07:16alostaleResolutionopen => out of date

Notes
(0126175)
hgbot   
2021-02-19 06:44   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 658ef158103e8cfcc5ae4ae5de330370f1cf5edf
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-02-19T06:42:32+01:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/658ef158103e8cfcc5ae4ae5de330370f1cf5edf [^]

fixes FR-45846: prepare infrastructure to support react applications

MR !301

Prepares infrastructure to support react applications:

    * Openbravo modules can define react applications within web-jspack directory
       * They have specific eslint rules defined in eslintrc-airbnb-react
       * They can define jest tests outside web-test directory
    * Jest tests are pre-compiled with babel to allow transforming jsx into JavaScript.
      This makes all jest test to be run in strict mode (FR-45019)

---
A babel.config.js
A jest.setup.js
A modules/org.openbravo.client.kernel/eslint-airbnb/eslintrc-airbnb-react.template
A modules/org.openbravo.client.kernel/jsutils/fileMock.js
M .githooks/pre-commit.d/00-jslint
M .githooks/pre-commit.d/01-jsformatter
M lerna.json
M modules/org.openbravo.client.kernel/eslint-airbnb/copy-config
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
M package-lock.json
M package.json
---
(0126177)
alostale   
2021-02-19 07:16   
After 0045846 jest tests are run in strict mode