Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

test the server code fail #19

Open
HaveF opened this issue Nov 7, 2016 · 3 comments
Open

test the server code fail #19

HaveF opened this issue Nov 7, 2016 · 3 comments

Comments

@HaveF
Copy link

HaveF commented Nov 7, 2016

I just export src/server/index.jss app, and write a dead simple test file to test server.

But failed like this after run kyt test:

  ● Test suite failed to run

    ReferenceError: KYT is not defined

      at Object.<anonymous> (server/server.js:13:28)

caused by this line in source code kyt-starter-universal/index.js

const clientAssets = require(KYT.ASSETS_MANIFEST); // eslint-disable-line import/no-dynamic-require

This line is total fine when I run kyt dev, but failed at kyt test, I thought it must be kyt/test.js does not pass right env like kyt/dev.js does.

I also find KYT is defined in kyt/webpack.base.js, but do not know how to fix.

Have any idea? Thanks

@delambo
Copy link
Member

delambo commented Nov 10, 2016

@HaveF - sorry for the late reply - can you try to set a KYT jest global: https://facebook.github.io/jest/docs/configuration.html#globals-object

@HaveF
Copy link
Author

HaveF commented Nov 11, 2016

@delambo Thanks for your reply:grin:. No, it does not work. I just set package.json as below:

  "jest": {
    "globals": {
      "KYT": true
    }
  }

Console still complain: ReferenceError: KYT is not defined

Have any other idea I can try?

@delambo
Copy link
Member

delambo commented Nov 19, 2016

Would you mind opening this in the main kyt repository? I don't have a good idea but hopefully someone else will.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants