Fix CI tests

There's a bunch of generated files that webpack relies on to work, and Karma works off webpack. To make both happy we've added
a new `build:genfiles` script which takes care of this for us. We also have to install and build our other layers to get the
same effect (like generating the react-sdk's component index, while we still have one).

This commit also fixes all the imports in the tests because they were just wrong. They should have been caught in the ES6ification
earlier, but were missed.
This commit is contained in:
Travis Ralston 2020-01-13 17:38:34 -07:00
parent 3b688aaeb8
commit a978a6734f
7 changed files with 31 additions and 40 deletions

View file

@ -18,28 +18,25 @@ limitations under the License.
import PlatformPeg from 'matrix-react-sdk/src/PlatformPeg';
import WebPlatform from '../../src/vector/platform/WebPlatform';
import * as sdk from "matrix-react-sdk";
import * as jssdk from "matrix-js-sdk";
import "../skin-sdk";
import React from "react";
import ReactDOM from "react-dom";
import ReactTestUtils from "react-dom/test-utils";
import expect from "expect";
import {makeType} from "matrix-react-sdk/src/utils/TypeUtils";
import {ValidatedServerConfig} from "matrix-react-sdk/src/utils/AutoDiscoveryUtils";
import {sleep} from "../test-utils";
import * as test_utils from "../test-utils";
import MockHttpBackend from "matrix-mock-request";
require('skin-sdk');
const jssdk = require('matrix-js-sdk');
const sdk = require('matrix-react-sdk');
const MatrixChat = sdk.getComponent('structures.MatrixChat');
const RoomDirectory = sdk.getComponent('structures.RoomDirectory');
const RoomPreviewBar = sdk.getComponent('rooms.RoomPreviewBar');
const RoomView = sdk.getComponent('structures.RoomView');
const React = require('react');
const ReactDOM = require('react-dom');
const ReactTestUtils = require('react-dom/test-utils');
const expect = require('expect');
import {makeType} from "matrix-react-sdk/src/utils/TypeUtils";
import {ValidatedServerConfig} from "matrix-react-sdk/src/utils/AutoDiscoveryUtils";
import {sleep} from "../test-utils";
const test_utils = require('../test-utils');
const MockHttpBackend = require('matrix-mock-request');
const HS_URL='http://localhost';
const IS_URL='http://localhost';
const USER_ID='@me:localhost';

View file

@ -18,23 +18,18 @@ limitations under the License.
import PlatformPeg from 'matrix-react-sdk/src/PlatformPeg';
import WebPlatform from '../../src/vector/platform/WebPlatform';
import 'skin-sdk';
import '../skin-sdk';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactTestUtils from 'react-dom/test-utils';
import expect from 'expect';
import MatrixReactTestUtils from 'matrix-react-test-utils';
import jssdk from 'matrix-js-sdk';
import sdk from 'matrix-react-sdk';
import * as jssdk from 'matrix-js-sdk';
import * as sdk from 'matrix-react-sdk';
import {MatrixClientPeg} from 'matrix-react-sdk/src/MatrixClientPeg';
import * as languageHandler from 'matrix-react-sdk/src/languageHandler';
import {VIEWS} from 'matrix-react-sdk/src/components/structures/MatrixChat';
import dis from 'matrix-react-sdk/src/dispatcher';
import * as test_utils from '../test-utils';
import MockHttpBackend from 'matrix-mock-request';
import {parseQs, parseQsFromFragment} from '../../src/vector/url_utils';