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

matcher: should be their own pkg #10238

Closed
jmesserly opened this issue Apr 26, 2013 · 14 comments
Closed

matcher: should be their own pkg #10238

jmesserly opened this issue Apr 26, 2013 · 14 comments
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.

Comments

@jmesserly
Copy link

I don't think matchers depend on unittest. Presumably they should not be in the unittest pkg?

@gramster
Copy link

I felt that way too but I think there was some pushback. If nothing else separating them out would mean they actually show up in API docs!

@DartBot
Copy link

DartBot commented May 2, 2013

This comment was originally written by [email protected]


Issue #3717 is of historical significance here.

@munificent
Copy link
Member

I'm fine with splitting them up. I think at the time our package reuse story wasn't quite as mature. We were still using SDK packages and the version solver wasn't as smart. Today, it should be easier to split these up while still being easy for users to consume them.

Would unittest.dart will export matchers.dart, or would users have to import both in their tests?

@sigmundch
Copy link
Member

I'd be happy to split them up, but I'd prefer if unittest reexports them by default.

@gramster
Copy link

gramster commented May 3, 2013

My assumption was that if we split them up, unittest would not import matcher, and so users would import both if they wanted to use out matchers and expect(). OTOH they could use a different matcher library if they want.

@gramster
Copy link

gramster commented May 3, 2013

We do have a different issue, which is asking for unittest to be renamed unit_test to be consistent with the style guide. So an option - although it's kinda hokey - would be to move unittest to unit_test, and have unittest be a shell that imports and reexports unit_test and matcher. That would mean we don't break any existing tests.

@gramster
Copy link

gramster commented May 3, 2013

The renaming issue is https://code.google.com/p/dart/issues/detail?id=10120

@sigmundch
Copy link
Member

Not sure.

I'd do the unittest exports unit_test + matchers just as a transition, maybe include a deprecation message so that users start switching their imports.

If people already have to rewrite their imports because we rename the package to 'unit_test', then that would be a great point to do a few other things like:

  • introduce new entrypoint files for each configuration (so instead of import unittest + import vm_config, you just import 'package:unit_test/vm_testing.dart')
  • maybe not including 'matchers' by default

I personally prefer that matchers is included because the great majority out there just wants to use it together with unittest, so there is less set up to do. If we don't it with unittest.dart, do people need to also add a pub dependency to get matchers?

@munificent
Copy link
Member

  • introduce new entrypoint files for each configuration (so instead of import unittest + import vm_config, you just import 'package:unit_test/vm_testing.dart')

I'm hesitant to do this because I worry it means people will couple their unit tests to a single configuration even when the code under test can run on multiple configs.

  • maybe not including 'matchers' by default

I believe unittest is and will be coupled to matcher, it's just that matcher is not coupled to unittest.

If we don't it with unittest.dart, do people need to also add a pub dependency to get matchers?

No, unittest depends on it, so you will get it transitively automatically.

@gramster
Copy link

Removed the owner.
Added Triaged label.

@DartBot
Copy link

DartBot commented Nov 4, 2013

This comment was originally written by @seaneagan


Any updates on this? I have some use cases for matchers outside of unit testing, and it's weird to have to include unittest to get to them. It also seems error prone, as unittest is often a dev_dependency, so it would work in development, but fail in production when unittest no longer appears in the "packages" dir.

@kevmoo
Copy link
Member

kevmoo commented May 9, 2014

Added Pkg-matcher label.

@kevmoo
Copy link
Member

kevmoo commented May 9, 2014

matcher has been its own package for a month+ now

Closing now that unittest no longer exports it: r35954


Added Fixed label.

@jmesserly jmesserly added Type-Defect area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. labels May 9, 2014
@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/test#2331.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.
Projects
None yet
Development

No branches or pull requests

6 participants