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

tests: Verify invalid schema handling #40

Merged
merged 2 commits into from
Dec 8, 2021

Conversation

l0b0
Copy link
Collaborator

@l0b0 l0b0 commented Dec 8, 2021

This does not test the error message printed, for two reasons:

  1. The original message comes from Ajv, which is outside the scope of
    this test.
  2. The message sent to console.error when inspecting the spy in the
    test, '--- https://example.org/invalid-schema.json: anyOf value must
    be ["array"]', is slightly different from the one actually printed to
    standard error when running the command, '---
    https://example.org/invalid-schema.json: schema is invalid:
    data/anyOf must be array'.

Closes #20.

@l0b0 l0b0 requested a review from m-mohr December 8, 2021 00:32
@l0b0 l0b0 force-pushed the tests/verify-invalid-schema-handling branch from e33a44a to e03ebac Compare December 8, 2021 00:36
@m-mohr
Copy link
Collaborator

m-mohr commented Dec 8, 2021

It looks like there's something wrong with this PR, it contains a lot of additional commits?!

@l0b0 l0b0 force-pushed the tests/verify-invalid-schema-handling branch from e03ebac to b961664 Compare December 8, 2021 00:46
@l0b0
Copy link
Collaborator Author

l0b0 commented Dec 8, 2021

My bad, I rebased onto origin/master rather than upstream/master.

@m-mohr
Copy link
Collaborator

m-mohr commented Dec 8, 2021

Thanks. There are some conflicts that need to be solved.
It seems I am not allowed to do it for your branch, so you need to do it before tests can run and I can merge.

This does *not* test the error message printed, for two reasons:

1. The original message comes from Ajv, which is outside the scope of
   this test.
2. The message sent to `console.error` when inspecting the spy in the
   test, '--- https://example.org/invalid-schema.json: anyOf value must
   be ["array"]', is slightly different from the one actually printed to
   standard error when running the command, '---
   https://example.org/invalid-schema.json: schema is invalid:
   data/anyOf must be array'.
@l0b0 l0b0 force-pushed the tests/verify-invalid-schema-handling branch from b961664 to 15d87be Compare December 8, 2021 00:54
@l0b0 l0b0 force-pushed the tests/verify-invalid-schema-handling branch from 15d87be to 1b37c55 Compare December 8, 2021 00:55
@m-mohr m-mohr merged commit f986ed8 into stac-utils:master Dec 8, 2021
@l0b0 l0b0 deleted the tests/verify-invalid-schema-handling branch December 8, 2021 02:25
l0b0 added a commit to linz/stac-node-validator that referenced this pull request Sep 7, 2022
* tests: Verify invalid schema handling

This does *not* test the error message printed, for two reasons:

1. The original message comes from Ajv, which is outside the scope of
   this test.
2. The message sent to `console.error` when inspecting the spy in the
   test, '--- https://example.org/invalid-schema.json: anyOf value must
   be ["array"]', is slightly different from the one actually printed to
   standard error when running the command, '---
   https://example.org/invalid-schema.json: schema is invalid:
   data/anyOf must be array'.

* tests: Bump coverage
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

Successfully merging this pull request may close these issues.

Add automated tests
2 participants