|
1 | 1 | "use strict"; |
2 | 2 | var actions_1 = require('../../actions'); |
| 3 | +var testName_1 = require('./test-run/testName'); |
3 | 4 | var types_1 = require('./types'); |
| 5 | +function testLoad() { |
| 6 | + return function (dispatch, getState) { |
| 7 | + var _a = getState(), dir = _a.dir, pagePosition = _a.pagePosition, tutorial = _a.tutorial, taskTests = _a.taskTests; |
| 8 | + var testFile = testName_1.default({ tutorial: tutorial, pagePosition: pagePosition }); |
| 9 | + dispatch({ |
| 10 | + type: types_1.TEST_LOAD, payload: { |
| 11 | + dir: dir, |
| 12 | + tests: taskTests, |
| 13 | + load: tutorial.config.load, |
| 14 | + testFile: testFile, |
| 15 | + } |
| 16 | + }); |
| 17 | + }; |
| 18 | +} |
| 19 | +exports.testLoad = testLoad; |
4 | 20 | function testRun() { |
5 | 21 | return function (dispatch, getState) { |
6 | 22 | var timeSinceLastTestRun = performance.now() - getState().testRun.time; |
7 | 23 | if (timeSinceLastTestRun < 1000) { |
8 | 24 | return; |
9 | 25 | } |
10 | | - var _a = getState(), taskTests = _a.taskTests, dir = _a.dir, tutorial = _a.tutorial, taskPosition = _a.taskPosition; |
| 26 | + var _a = getState(), taskTests = _a.taskTests, dir = _a.dir, tutorial = _a.tutorial, taskPosition = _a.taskPosition, pagePosition = _a.pagePosition; |
| 27 | + var testFile = testName_1.default({ tutorial: tutorial, pagePosition: pagePosition }); |
11 | 28 | dispatch({ |
12 | | - type: types_1.TEST_RUN, payload: { taskTests: taskTests, dir: dir, tutorial: tutorial, taskPosition: taskPosition } |
| 29 | + type: types_1.TEST_RUN, |
| 30 | + payload: { taskTests: taskTests, dir: dir, tutorial: tutorial, taskPosition: taskPosition, testFile: testFile } |
13 | 31 | }); |
14 | 32 | }; |
15 | 33 | } |
16 | 34 | exports.testRun = testRun; |
17 | | -function testLoad() { |
18 | | - return function (dispatch, getState) { |
19 | | - var _a = getState(), dir = _a.dir, pagePosition = _a.pagePosition, tutorial = _a.tutorial; |
20 | | - dispatch({ |
21 | | - type: types_1.TEST_LOAD, payload: { |
22 | | - dir: dir, |
23 | | - pagePosition: pagePosition, |
24 | | - tutorial: { |
25 | | - name: tutorial.name, |
26 | | - version: tutorial.version |
27 | | - } |
28 | | - } |
29 | | - }); |
30 | | - }; |
31 | | -} |
32 | | -exports.testLoad = testLoad; |
33 | 35 | function testResult(result) { |
34 | 36 | return function (dispatch, getState) { |
35 | 37 | var _a = getState(), taskActions = _a.taskActions, progress = _a.progress, pagePosition = _a.pagePosition; |
|
0 commit comments