Skip to content

[ospec] Add the possibility to name new test suites #1529

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

Merged
merged 2 commits into from
Jul 6, 2017

Conversation

pygy
Copy link
Member

@pygy pygy commented Jan 10, 2017

I'm using ospec in a monorepo setting with a single test runner for the whole project. I'd like to have per module test stats that can be identified more easily. Currently, only the number of test appears, with the PR, it would become $suiteName: 385 assertions completed in 122ms, of which 0 failed.

Suggested use:

// modules/foo/test-utils/ospec-instance.js
var o = require('ospec')
var instance = module.export = o.new('suite name')
o('suite name', instance.run)

Then, in each test file of a given module, replace require('ospec') with require('../test-utils/ospec-instance').

@lhorie lhorie closed this Jan 30, 2017
@pygy
Copy link
Member Author

pygy commented Jan 30, 2017

@lhorie had this any chance of getting merged?

@pygy pygy changed the base branch from rewrite to next January 30, 2017 18:50
@dead-claudia dead-claudia reopened this Jan 30, 2017
@dead-claudia
Copy link
Member

Closing, since this issue has not been updated in over a month, and typically, issues inactive for that long do not usually produce any action. If you feel something in Mithril needs added or changed, please file a new issue.

@pygy
Copy link
Member Author

pygy commented Mar 27, 2017

I actually would like to have this merged...

@pygy pygy reopened this Mar 27, 2017
@dead-claudia
Copy link
Member

@pygy Could you add tests, then? Also, name is never set.

@pygy
Copy link
Member Author

pygy commented Mar 28, 2017

I'll have to look at how to test this... It's not trivial. It manifests itself through STDOUT, the state is private.

name is set by calling ospec.new("some name").

@dead-claudia
Copy link
Member

Oh. I'm not well versed on ospec's API, and only know just enough to pass (I use either Mocha or something else entirely).

@tivac
Copy link
Contributor

tivac commented Apr 11, 2017

This seems pretty useful, and a very small change. I'm in favor. @pygy if you fix the conflicts we should merge this unless @lhorie disagrees.

@dead-claudia dead-claudia added the Status: Needs test case For pull requests that lack one or more test cases for the feature or behavior in question label Apr 11, 2017
@pygy
Copy link
Member Author

pygy commented Jul 6, 2017

Conflicts fixed (there were none, really, the changes were on different lines, dunno what prompted them in the first place)... Merging!

@pygy pygy merged commit 34c3430 into MithrilJS:next Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs test case For pull requests that lack one or more test cases for the feature or behavior in question
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants