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

Added unit testing #16

Merged
merged 14 commits into from Feb 12, 2019
Merged

Added unit testing #16

merged 14 commits into from Feb 12, 2019

Conversation

freave-public
Copy link
Contributor

Changes proposed in this pull request:

  • This merge request adds unit testing the CLI using the Mocha testing framework.
  • Removed installers from the readme in favor of installing the CLI through NPM.
  • Some minor refactoring of the services.
  • Ignored .DS_STORE (MacOS)

@TLadd
Copy link
Contributor

TLadd commented Feb 6, 2019

Ran into some errors when running the tests:

       should perform a http post call:

      AssertionError [ERR_ASSERTION]: Mocks not yet satisfied:
POST https://gateway.stackpath.com:443/cdn/v1/stacks/1/sites/2/scripts
      + expected - actual

      -false
      +true

      at Scope.done (node_modules/nock/lib/scope.js:155:10)
      at Object.finally (node_modules/fancy-test/lib/nock.js:30:29)
      at Context.run (node_modules/fancy-test/lib/base.js:59:36)

  2) service http
       should perform a http patch call:

      AssertionError [ERR_ASSERTION]: Mocks not yet satisfied:
PATCH https://gateway.stackpath.com:443/cdn/v1/stacks/1/sites/2/scripts/3
      + expected - actual

      -false
      +true

      at Scope.done (node_modules/nock/lib/scope.js:155:10)
      at Object.finally (node_modules/fancy-test/lib/nock.js:30:29)
      at Context.run (node_modules/fancy-test/lib/base.js:59:36)

  3) service http
       should throw a http error:

      AssertionError [ERR_ASSERTION]: Mocks not yet satisfied:
POST https://gateway.stackpath.com:443/error
      + expected - actual

      -false
      +true

      at Scope.done (node_modules/nock/lib/scope.js:155:10)
      at Object.finally (node_modules/fancy-test/lib/nock.js:30:29)
      at Context.run (node_modules/fancy-test/lib/base.js:59:36)

  4) service http
       should not throw a http error:
     AssertionError: expected [Error: An error occurred when connecting to StackPath host https://gateway.stackpath.com.] to not exist
      at Context.test_1.test.nock.it (test/services/http.test.ts:36:25)```

test/services/validation.test.ts Outdated Show resolved Hide resolved
test/services/http.test.ts Outdated Show resolved Hide resolved
test/services/http.test.ts Outdated Show resolved Hide resolved
test/services/http.test.ts Outdated Show resolved Hide resolved
test/helpers/mock-helper.ts Outdated Show resolved Hide resolved
test/services/validation.test.ts Outdated Show resolved Hide resolved
test/helpers/mock-helper.ts Outdated Show resolved Hide resolved
test/services/http.test.ts Outdated Show resolved Hide resolved
test/services/http.test.ts Outdated Show resolved Hide resolved
Co-Authored-By: freave-public <47330101+freave-public@users.noreply.github.com>
@klaude klaude merged commit e385961 into stackpath:master Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants