From ba8e37a84ef52c6d6173d655df20f6eaba0baf26 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 25 May 2017 23:13:49 +0100 Subject: [PATCH] Don't include src in the test resolve root Don't include src in resolve root for the karma test, as otherwise modules from react sdk get pulled in instead of npm libraries like 'extend' which breaks everything in really subtle ways. --- karma.conf.js | 1 - test/components/views/dialogs/InteractiveAuthDialog-test.js | 2 +- test/components/views/rooms/MessageComposerInput-test.js | 2 +- test/utils/MegolmExportEncryption-test.js | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 3495a981be..13e88350c1 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -166,7 +166,6 @@ module.exports = function (config) { 'sinon': 'sinon/pkg/sinon.js', }, root: [ - path.resolve('./src'), path.resolve('./test'), ], }, diff --git a/test/components/views/dialogs/InteractiveAuthDialog-test.js b/test/components/views/dialogs/InteractiveAuthDialog-test.js index b8a8e49769..c8f16225de 100644 --- a/test/components/views/dialogs/InteractiveAuthDialog-test.js +++ b/test/components/views/dialogs/InteractiveAuthDialog-test.js @@ -22,7 +22,7 @@ import ReactTestUtils from 'react-addons-test-utils'; import sinon from 'sinon'; import sdk from 'matrix-react-sdk'; -import MatrixClientPeg from 'MatrixClientPeg'; +import MatrixClientPeg from '../../../../src/MatrixClientPeg'; import * as test_utils from '../../../test-utils'; diff --git a/test/components/views/rooms/MessageComposerInput-test.js b/test/components/views/rooms/MessageComposerInput-test.js index ca2bbba2eb..67e788e2eb 100644 --- a/test/components/views/rooms/MessageComposerInput-test.js +++ b/test/components/views/rooms/MessageComposerInput-test.js @@ -8,7 +8,7 @@ import * as testUtils from '../../../test-utils'; import sdk from 'matrix-react-sdk'; import UserSettingsStore from '../../../../src/UserSettingsStore'; const MessageComposerInput = sdk.getComponent('views.rooms.MessageComposerInput'); -import MatrixClientPeg from 'MatrixClientPeg'; +import MatrixClientPeg from '../../../../src/MatrixClientPeg'; function addTextToDraft(text) { const components = document.getElementsByClassName('public-DraftEditor-content'); diff --git a/test/utils/MegolmExportEncryption-test.js b/test/utils/MegolmExportEncryption-test.js index 0c49fd48d1..1c90c7a030 100644 --- a/test/utils/MegolmExportEncryption-test.js +++ b/test/utils/MegolmExportEncryption-test.js @@ -16,7 +16,7 @@ limitations under the License. "use strict"; -import * as MegolmExportEncryption from 'utils/MegolmExportEncryption'; +import * as MegolmExportEncryption from '../../src/utils/MegolmExportEncryption'; import * as testUtils from '../test-utils'; import expect from 'expect';