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

cargo test doesn't pass #33

Closed
adrianN opened this issue Jan 18, 2020 · 1 comment
Closed

cargo test doesn't pass #33

adrianN opened this issue Jan 18, 2020 · 1 comment

Comments

@adrianN
Copy link

adrianN commented Jan 18, 2020

I'm probably doing something stupid. I cloned the repo (my HEAD is at 09dabbd) and ran cargo test. I get

failures:

---- src/lib.rs -  (line 9) stdout ----
error[E0432]: unresolved import `ureq::json`
 --> src/lib.rs:11:5
  |
5 | use ureq::json;
  |     ^^^^^^^^^^ no `json` in the root

error: cannot determine resolution for the macro `json`
  --> src/lib.rs:16:16
   |
10 |     .send_json(json!({
   |                ^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error[E0599]: no method named `send_json` found for type `&mut ureq::Request` in the current scope
  --> src/lib.rs:16:6
   |
10 |     .send_json(json!({
   |      ^^^^^^^^^ method not found in `&mut ureq::Request`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
Couldn't compile the test.

failures:
    src/lib.rs -  (line 9)

test result: FAILED. 47 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

I assume it's supposed to pass because CI is working. My rustc is stable-x86_64-apple-darwin unchanged - rustc 1.40.0 (73528e339 2019-12-16)

@lolgesten
Copy link
Contributor

The problem is that the json features is needed for the doc tests and isn't enabled by default. AFAIK, there isn't currently a way to turn on features just for cargo test.

Try running cargo test --all-features

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