Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: It doesn't recognise the project #10

Closed
AvraamMavridis opened this issue Jan 3, 2018 · 7 comments
Closed

Bug: It doesn't recognise the project #10

AvraamMavridis opened this issue Jan 3, 2018 · 7 comments

Comments

@AvraamMavridis
Copy link

AvraamMavridis commented Jan 3, 2018

Is this a bug report or a feature request?

馃悰.

Version Info

  • Version of Majestic: 0.1.0
  • Version of Jest: latest
  • Version of Node: 8.7
  • Operating System: OS X

This is my configuration on package.json

  "jest": {
    "moduleDirectories": [
      "./ui-lib/src",
      "./ui-lib/node_modules",
      "node_modules",
      "./obs",
      "./obs/node_modules"
    ],
    "moduleNameMapper": {
      "^.+\\.(jpg|jpeg|png|gif|eot|webp|svg|ttf|woff|woff2)$": "<rootDir>/jest/fileMock.js",
      "^.+\\.(css|scss)$": "identity-obj-proxy",
      "frontend/ui-lib(.*)$": "<rootDir>/ui-lib/$1"
    },
    "transform": {
      "^.+\\.js?$": "babel-jest",
      ".*": "<rootDir>/node_modules/jest-css-modules"
    },
    "transformIgnorePatterns": [
      "/node_modules/(?!(frontend)/).*/",
      "obs/node_modules/(?!(frontend)/).*/"
    ],
    "setupFiles": [
      "raf/polyfill",
      "<rootDir>/jest.init.js"
    ],
    "collectCoverage": true,
    "coverageDirectory": "./coverage",
    "coverageReporters": [
      "html",
      "text-summary"
    ]
  },

No files are shown up in the sidebar, when I press the run test, nothing happens. No error displayed either though.

@Raathigesh
Copy link
Owner

The issue is you are relying on the default test regex pattern and your configuration does not have a test regex pattern or a test match pattern. I completely overlooked the defaults of these patterns so that's why it doesn's show up.

I'll have a release ready with this fix in a couple of days. But if you need to try the app, just add the following to the jest config.

"jest": {
    "testMatch": [ '**/__tests__/**/*.js?(x)', '**/?(*.)(spec|test).js?(x)' ]
// other configs
}

let me know if you managed to get it to work after this workaround.

@AvraamMavridis
Copy link
Author

@Raathigesh yep that solved the problem, the tests are recognized, there are some other bugs but I guess are not related and you will solve them in feature releases. Thx a lot, great project!

@Raathigesh
Copy link
Owner

Feel free to open issues for other issues. Happy to address them.

@AvraamMavridis
Copy link
Author

Sure, thx a lot

@bradleyess
Copy link

bradleyess commented Jan 8, 2018

I believe it would be helpful to be slightly more verbose in the documentation on what is required from the jest.config file - as it's possible to run basic Jest suites without needing a config object.

Something along the lines of this would be great.

Majestic requires the following Jest config object/file at minimum in order to recognise your test suite.

{
        "testMatch": [
            "**/__tests__/**/*.js?(x)",
            "**/?(*.)(spec|test).js?(x)"
        ],
        "collectCoverage": true,
        "coverageReporters": ["html", "text-summary"]
},

@Raathigesh
Copy link
Owner

Majestic should work with the config Jest works with. This is a bug of majestic and its fixed in the master. Should be available with the next release.

@Raathigesh
Copy link
Owner

This fix is released in https://github.com/Raathigesh/majestic/releases/tag/v0.2.0

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

No branches or pull requests

3 participants