blakeembrey / co-mocha Goto Github PK
View Code? Open in Web Editor NEWEnable support for generators in Mocha tests
License: MIT License
Enable support for generators in Mocha tests
License: MIT License
Hey,
I see Co-Mocha v0.0.3 started to support promises. That's all great, but that is not the concern of this library. Not to mention Mocha itself supports promises now, but none-the-less, I suggest keeping libraries small and to the point. ;-)
Branch | Build failing π¨ |
---|---|
Dependency | mocha |
Current Version | 3.2.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As mocha is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
Thanks to all our contributors, maintainers, sponsors, and users! β€οΈ
As highlights:
--inspect-brk
on command-line (@igwejk)semistandard
directly (@kt3k)The new version differs by 89 commits0.
fb1687e
:ship: Release v3.3.0
1943e02
Add Changelog for v3.3.0
861e968
Refactor literal play-icon hex code to a var
1d3c5bc
Fix typo in karma.conf.js
9bd9389
Fix spec paths in test HTML files
0a93024
Adds tests for loading reporters w/ relative/absolute paths (#2773)
73929ad
Comment special treatment of '+' in URL query parsing
e2c9514
Merge pull request #2769 from igwejk/support_inspect_break_in_opts
038c636
Support --inspect-brk
on command-line
b4ebabd
Merge pull request #2727 from lamby/reproducible-build
882347b
Please make the build reproducible.
a2fc76c
Merge pull request #2703 from seppevs/cover_utils_some_fn_with_tests
ed61cd0
cover .some() function in utils.js with tests
f42cbf4
Merge pull request #2701 from craigtaub/landingSpec
6065242
use stubbed symbol
There are 89 commits in total.
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
I've made an example repository here to demonstrate the issue: https://github.com/TMiguelT/co-mocha-test
To run it, use:
git clone https://github.com/TMiguelT/co-mocha-test\
&& cd co-mocha-test\
&& npm install\
&& npm test
The code in question is this:
require('co-mocha');
require('assert');
describe("describe", () => {
it("it", function *(done){
assert(1 + 1 == 2);
done();
});
});
Basically, this causes a timeout error because done()
is never called because the assert()
fails. However ideally co-mocha would catch this error and pass it back to mocha to indicate a failed test.
Branch | Build failing π¨ |
---|---|
Dependency | mocha |
Current Version | 4.0.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
This is mainly a "housekeeping" release.
Welcome @Bamieh and @xxczaki to the team!
progress
reporter now accepts reporter options (@canoztokmak)xit
in bdd
interface now properly returns its Test
object (@Bamieh)--help
will now help you even if you have a mocha.opts
(@Zarel)--no-diff
flag will completely disable diff output (@CapacitorSet)docs/
(@boneskull)The new version differs by 409 commits.
6b9ddc6
Release v4.1.0
3c4b116
update CHANGELOG for v4.1.0
5be22b2
options.reporterOptions
are used for progress reporter
ea96b18
add .fossaignore [ci skip]
adc67fd
Revert "[ImgBot] optimizes images (#3175)"
ae3712c
[ImgBot] optimizes images (#3175)
33db6b1
Use x64 node on appveyor
4a6e095
Run appveyor tests on x64 platform. Might enable sharp installation
3abed9b
Lint netlify-headers script
119543e
Add preconnect for doubleclick domain that google analytics results in contacting
bd5109e
Remove crossorigin='anonymous' from preconnect hints. Only needed for fonts, xhr and es module loads
123ee4f
Handle the case where all avatars are already loaded at the time when the script exexecutes
64deadc
Specific value for inlining htmlimages to guarantee logo is inlined
8f1ded4
https urls where possible
d5a5125
Be explicit about styling of screenshot images
There are 250 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Branch | Build failing π¨ |
---|---|
Dependency | mocha |
Current Version | 3.5.3 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As mocha is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
You might want to read this before filing a new bug! π
For more info, please read this article.
node
from exiting will do so when run in Mocha. Supply the --exit
flag to revert to pre-v4.0.0 behavior (@ScottFreeCode, @boneskull)stdout:
prefix from browser reporter logs (@skeggse)--forbid-pending
or --forbid-only
is specified (@ScottFreeCode)--compilers
command-line option is now soft-deprecated and will emit a warning on STDERR
. Read this for more info and workarounds (@ScottFreeCode, @boneskull)The new version differs by 48 commits.
d69bf14
Release v4.0.0
171b9f9
pfix "prepublishOnly" potential portability problem
60e39d9
Update link to wiki (GitHub at the leading --
)
804f9d5
Update link because GitHub ate the leading --
3326c23
update CHANGELOG for v4.0.0 [ci skip]
6dd9252
add link to wiki on --compilers deprecation
96318e1
Deprecate --compilers
92beda9
drop bower support
58a4c6a
remove unused .npmignore
7af6611
kill Date#toISOString shim
43501a2
reduce noise about slow tests; make a few tests faster, etc.
fa228e9
update --exit / --no-exit integration test for new default behavior
3fdd3ff
Switch default from forced exit to no-exit
c5d69e0
add integration tests for --exit/--no-exit
3a7f8dc
enhance runMochaJSON() helper by returning the subprocess instance
There are 48 commits in total.
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
npminstall
is an insanely fast npm module installer: https://github.com/cnpm/npminstall
However, npminstall
uses an alternative module management mechanism that co-mocha
fails to understand.
A typical mocha path from require.cache
looks like: /Users/adam/Projects/some-project/node_modules/mocha/index.js
While an npminstall
ed mocha path from require.cache
looks like: /Users/adam/Projects/some-project/node_modules/.2.2.5@mocha/index.js
This prevents co-mocha
from finding the cached mocha
module object.
Hi, I am using co-mocha, and could you upgrade the dependence co
to version 4.x ? thanks!
Branch | Build failing π¨ |
---|---|
Dependency | mocha |
Current Version | 3.1.2 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As mocha is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
Mocha is proud to have joined the JS Foundation. For more information, read the announcement.
Under the foundation, all contributors to Mocha must sign the JS Foundation CLA before their code can be merged. When sending a PR--if you have not already signed the CLA--a friendly bot will ask you to do so.
Mocha remains licensed under the MIT license.
--watch
encounters broken symlinks (@villesau)list
reporter (@Aldaviva)--inspect
flag to CLI help (@ughitsaaron)README.md
(@boneskull, @ScottFreeCode, @dasilvacontin)Thanks to all our contributors, sponsors and backers! Keep on the lookout for a public roadmap and new contribution guide coming soon.
The new version differs by 21 commits .
b51e360
Release v3.2.0
5badf0b
rebuild mocha.js for release v3.2.0 [ci skip]
b1d6b49
update CHANGELOG.md
for v3.2.0 [ci skip]
7a05a6c
use spec reporter in tests by default; closes #2594
004389f
tweak timeout messaging; see #2294
12afaf7
cleanup .gitignore [ci skip]
edde033
fix XUnit reporter output. Closes #2584
f5bef7c
Revert test pass symbol in List reporter
4a2e85a
ignore files files which are not found by files() (#2538)
79d7414
Add Browser Support Matrix to README.md (#2590) [ci skip]
1d52fd3
use karma-mocha; closes #2570
8941442
adds info about --inspect flag to options in --help
71e7a1e
rename some fixture files that had the wrong extension
1a45929
typo in comment
b5a424a
Link license from current branch
There are 21 commits in total. See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Branch | Build failing π¨ |
---|---|
Dependency | mocha |
Current Version | 3.3.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As mocha is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
Mocha is now moving to a quicker release schedule: when non-breaking changes are merged, a release should happen that week.
This week's highlights:
allowUncaught
added to commandline as --allow-uncaught
(and bugfixed)--no-warnings
and --trace-warnings
flags (@sonicdoe)The new version differs by 9 commits0.
7554b31
Add Changelog for v3.4.0
9f7f7ed
Add --trace-warnings
flag
92561c8
Add --no-warnings
flag
ceee976
lint test/integration/fixtures/simple-reporter.js
dcfc094
Revert "use semistandard
directly"
93392dd
no special case for macOS running Karma locally
4d1d91d
--allow-uncaught cli option
fb1e083
fix allowUncaught in browser
4ed3fc5
Add license report and scan status
false
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
[email protected]
[email protected]
"co-mocha": "^1.1.3",
"mocha": "^3.0.2",
describe('Push', function() {
it('hello', function*() {
throw new Error('xxx');
});
});
$ mocha test/push.js
Push
β hello
1 passing (7ms)
Initialization
should initialize the main object β£
"use strict";
let contestData = {
question1: 'How Are you?',
answer1: 'Fine, thanks.',
question2: 'Status',
answer2: 'Great',
question3: 'Who is the greatest painter?',
answer3: 'Raphael'
};
expect(contestData.question1).to.equal('How Are you?');
expect(GetSystemThemeName()).to.equal('aero');
expect(testSystemInformation()).to.be.true;
should do something β£
return co.call(this, fn.apply(this, arguments));
The result content of should do something β£
exposeed co.call`
We may need more specific function content.
Branch | Build failing π¨ |
---|---|
Dependency | mocha |
Current Version | 3.4.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As mocha is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
The new version differs by 7 commits.
a15b20a
:ship: Release v3.4.2
fc802a9
:memo: Add Changelog for v3.4.2
10ff0ec
Eagerly set process.exitCode (#2820)
fc35691
Merge pull request #2818 from makepanic/issue/2802
3e7152f
Remove call to deprecated os.tmpDir (#2802)
e249434
Merge pull request #2807 from mochajs/npm-script-lint
17a1770
Move linting into an npm script. Relates to #2805
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Hi,
I can't seem to make a generator based test fail. Even changing your supplied tests to add up to a different value than expected always seems to pass. I've tried this from node 0.11.8 to 0.11.12.
EG
it('should work with generators', function* () {
assert.equal(1 + 5, 3);
yield wait(100);
});
or
it('should work with generators', function* () {
assert.equal(yield(1 + 5), 3);
});
I followed this approach with the same results
https://labnotes.org/yield-to-the-test-using-mocha-with-es6-generators/
Do you have any idea on what I'm doing wrong here.?
This is my mocha.opts
--reporter spec
--require co-mocha
command line
mocha --harmony
Thanks
Is it me or does the (latest?) Co-Mocha release break the contexts of before
blocks? Looking at the code only one call
is used.
Did a talk about this topic yesterday at the ember.js meetup in Munich. Have fun watching it :)
it('should throw', function*(){
throw new Error('boom!');
});
I'm hitting a problem in my tests and I can get the same thing with the simplest of tests. Using the file simple.js containing:
it('should do something', function* () {
yield;
});
When I run:
node node_modules/mocha/bin/mocha --require co-mocha simple.js
I get
1) should do something:
TypeError: You may only yield a function, promise, generator, array, or object, but the following object was passed: "undefined"
at next (/Users/p14n/dev/tools/moch/node_modules/co-mocha/node_modules/co/index.js:100:25)
co-mocha 1.1.0
mocha 2.0.1
node 1.6.4
I can't see why that wouldn't work?
Cheers
Right now, I am testing .should.throw()
with some ugly hacks. It would be nice to have this support with co-mocha
.
Something like
(yield function * () { /* async code */ }).should.throw();
Can you please add support for mocha version > 5?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.