Skip to content

Commit 59ce87e

Browse files
committed
Fails tests - commit to request help
One change breaks something else with linting error so to test first change must fix next change, which breaks more stuff by the time we finally get rid of linting errors, we've changed SOO much ALL the problems revolve around: export * from 'somewhere' import {something} from 'somewhere' -> import something from 'somewhere' import {default as something} from 'somewhere' Read docs from following pages but still don't understand - VERY confusingly written: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import https://esdiscuss.org/topic/import-statements-destructuring babel/babel#3049 http://www.thedreaming.org/2017/04/28/es6-imports-babel/ babel/babel-loader#194 https://stackoverflow.com/questions/4832829/import-javascript-file-from-within-javascript-synchronously babel/babel#4996 https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md import-js/eslint-plugin-import#49 microsoft/TypeScript#2440 https://stackoverflow.com/questions/33505992/babel-6-changes-how-it-exports-default/33506169#33506169
1 parent 41f06f6 commit 59ce87e

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

src/server/actions/__tests__/assertSurveyIsComplete.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import {resetDB, useFixture} from 'src/test/helpers'
66

77
import assertSurveyIsComplete from '../assertSurveyIsComplete'
88

9+
console.log('useFixture inside test~~~>', useFixture)
10+
console.log('resetDB inside test~~~>', resetDB)
11+
912
describe(testContext(__filename), function () {
1013
useFixture.buildOneQuestionSurvey()
1114

src/test/helpers/fixtures.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
import nock from 'nock'
44

55
import config from 'src/config'
6-
import {default as Models} from 'src/server/services/dataService'
6+
import {Cycle, Project} from 'src/server/services/dataService'
77
import factory from 'src/test/factories'
88

9-
const Cycle = Models.Cycle
10-
const Project = Models.Project
11-
12-
export const useFixture = {
9+
const useFixture = {
1310
buildOneQuestionSurvey() {
1411
beforeEach(function () {
1512
this.buildOneQuestionSurvey = async function ({questionAttrs, subjectIds}) {
@@ -181,3 +178,5 @@ export const useFixture = {
181178
})
182179
}
183180
}
181+
182+
export default useFixture

src/test/helpers/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
module.exports = Object.assign({},
2-
require('./db'),
1+
import useFixture from 'src/test/helpers/fixtures'
2+
3+
console.log('~~~> useFixture', useFixture)
4+
5+
const theImports = Object.assign({},
36
require('./graphql'),
4-
require('./fixtures'),
57
require('./expectations'),
68
require('./idmMocks'),
79
)
10+
11+
export theImports
12+
export * from './db'

0 commit comments

Comments
 (0)