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

Old mocha versions in mustache templates #1383

Open
char0n opened this issue Oct 31, 2019 · 2 comments
Open

Old mocha versions in mustache templates #1383

char0n opened this issue Oct 31, 2019 · 2 comments

Comments

@char0n
Copy link

char0n commented Oct 31, 2019

views/mochachairunner.mustache and views/mocharunner.mustache loads very old versions of mocha. Specificaly 2.3.4. Would it be possible to update it to latest version ? I understand that might be problems with backward compatibility, but still using that old version of mocha is not warranted.

For anybody looking for workaround: create your own test page:

mocha-testem.mustache

<!doctype html>
<html>
<head>
    <title>Test'em</title>
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/mocha/6.2.0/mocha.css">
    <script src="//cdnjs.cloudflare.com/ajax/libs/mocha/6.2.0/mocha.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.js"></script>
    <script src="/testem.js"></script>
    <script>
        mocha.setup('bdd');
    </script>
    <script src="../tmp-test-bundle.js"></script>
</head>
<body>
<div id="mocha"></div>
<script>
    mocha.run();
</script>
</body>
</html>

and link it in your testem config testem.json:

{
"test_page": "./mocha-testem.mustache",
"before_tests": "npm run test:bundle-create",
"after_tests": "npm run test:bundle-clean"
}

Now we're able to use features like this.skip() inside our tests.

describe('test', function() {
  before(function() {
    if (condition) {
      this.skip();
    }
  });
});

Running this test via testem would not be possible without this workaround.

@char0n
Copy link
Author

char0n commented Oct 31, 2019

Linking the PR where I discovered the problem and fixed it there: char0n/ramda-adjunct#1141

@raycohen
Copy link

raycohen commented Nov 10, 2019

this is also true for QUnit, which is set to version 1.20.0 in the default runner for the qunit framework. The current release of QUnit is 2.9.2.

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

2 participants