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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Mocha and Jasmine #13

Open
tomitrescak opened this issue Mar 5, 2019 · 0 comments
Open

Add support for Mocha and Jasmine #13

tomitrescak opened this issue Mar 5, 2019 · 0 comments

Comments

@tomitrescak
Copy link
Owner

@nishatshama please add support for Mocha and Jasmine.
All we need is a reporter that stores following format:

module.exports.report = {
  "numFailedTests": 3,
  "numPassedTests": 5,
  "numTotalTests": 8,
  "testResults": [
    {
      "testFilePath": "/tests/foo.test",
      "testResults": [
        {
          "ancestorTitles": [
            "Component",
            "Foo"
          ],
          "duration": 2,
          "failureMessages": [],
          "fullName": "Component Foo renders correctly",
          "location": null,
          "numPassingAsserts": 0,
          "status": "passed",
          "title": "renders correctly"
        },
        {
          "ancestorTitles": [
            "Component",
            "Foo"
          ],
          "duration": 0,
          "failureMessages": [
            "Error Message" 
          ],
          "fullName": "Component Foo shows difference",
          "location": null,
          "numPassingAsserts": 0,
          "status": "failed",
          "title": "shows difference"
        },
      ],
      "numFailingTests": 1,
      "numPassingTests": 1
    },
  ]
}

module.exports.snapshots = {
    '/tests/apollo.test':  require('./tests/__snapshots__/apollo.test.tsx.snap'),
    ....
}

What you see is that tests are reported per test suite (file) and each file reports all tests ran in that file.

I have already prepared the files for you with the base structure. The files are in /src/jasmine/reporter.ts and /src/mocha/reporter.ts.

For now we do not have to do the snapshots, but we will definitely look into supporting them in the future as I wrote a custom package for mocha snapshots some time ago.

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

1 participant