You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2019/01/25 19:34:06 UTC

[airavata-django-portal] branch master updated: Fix Jest unit tests by ignoring CSS imports

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git


The following commit(s) were added to refs/heads/master by this push:
     new ba6a2c3  Fix Jest unit tests by ignoring CSS imports
ba6a2c3 is described below

commit ba6a2c3be809595142b0f8fbba6f996d9c7268bd
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Fri Jan 25 14:33:56 2019 -0500

    Fix Jest unit tests by ignoring CSS imports
---
 django_airavata/apps/workspace/jest.config.js                         | 4 +++-
 .../static/django_airavata_workspace/tests/__mocks__/styleMock.js     | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/django_airavata/apps/workspace/jest.config.js b/django_airavata/apps/workspace/jest.config.js
index 004f9f6..eb44609 100644
--- a/django_airavata/apps/workspace/jest.config.js
+++ b/django_airavata/apps/workspace/jest.config.js
@@ -11,7 +11,9 @@ module.exports = {
     '^.+\\.jsx?$': 'babel-jest'
   },
   moduleNameMapper: {
-    '^@/(.*)$': '<rootDir>/static/django_airavata_workspace/js/$1'
+    '^@/(.*)$': '<rootDir>/static/django_airavata_workspace/js/$1',
+    // Ignore style imports. From https://jestjs.io/docs/en/webpack#handling-static-assets
+    "\\.(css|less)$": "<rootDir>/static/django_airavata_workspace/tests/__mocks__/styleMock.js"
   },
   snapshotSerializers: [
     'jest-serializer-vue'
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/tests/__mocks__/styleMock.js b/django_airavata/apps/workspace/static/django_airavata_workspace/tests/__mocks__/styleMock.js
new file mode 100644
index 0000000..f053ebf
--- /dev/null
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/tests/__mocks__/styleMock.js
@@ -0,0 +1 @@
+module.exports = {};