Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

refactor(samples): convert sample tests from ava to mocha #133

Merged
merged 12 commits into from
Nov 23, 2018

Conversation

nareshqlogic
Copy link
Contributor

Fixes convert all sample tests from ava to mocha #2865 (it's a good idea to open an issue first for discussion)

  • Tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 15, 2018
@JustinBeckwith JustinBeckwith added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 16, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 16, 2018
Copy link
Contributor

@JustinBeckwith JustinBeckwith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good except for the 2 comments :)

samples/.eslintrc.yml Outdated Show resolved Hide resolved
samples/package.json Outdated Show resolved Hide resolved
@JustinBeckwith JustinBeckwith added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 19, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 19, 2018
@JustinBeckwith
Copy link
Contributor

Looks like a few interesting test failures:


  7 passing (6s)
  3 failing
  1) should synthesize audio from ssml:
      AssertionError [ERR_ASSERTION]: true === false
      + expected - actual
      -true
      +false
      at Context.it (system-test/synthesize.test.js:54:10)
  2) should synthesize audio from text file:
      AssertionError [ERR_ASSERTION]: true === false
      + expected - actual
      -true
      +false
      at Context.it (system-test/synthesize.test.js:64:10)
  3) should synthesize audio from ssml file:
      AssertionError [ERR_ASSERTION]: true === false
      + expected - actual
      -true
      +false
      at Context.it (system-test/synthesize.test.js:74:10)
(node:108) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:108) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:108) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:108) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:108) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.

@nareshqlogic
Copy link
Contributor Author

Hi @JustinBeckwith ,
I think file unlink should be executed after each test case as it is creating same file(test-output.mp3) in each one test case. So I changed from after to afterEach block. Let me correct if I am wrong.

@JustinBeckwith JustinBeckwith added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 20, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 20, 2018
@JustinBeckwith
Copy link
Contributor

Sounds good to me, but we probably want to make sure it actually exists first, or wrap the unlink in a try/catch :)


  1 passing (787ms)
  1 failing
  1) "after each" hook:
     Uncaught Error: ENOENT: no such file or directory, unlink 'test-output.mp3'

@nareshqlogic
Copy link
Contributor Author

Thank you Justin. I warped the unlink in a try/catch.

@JustinBeckwith JustinBeckwith added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 22, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 22, 2018
@JustinBeckwith JustinBeckwith merged commit c6c4edd into googleapis:master Nov 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants