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

feat: async test case switch #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on May 28, 2020

  1. Add async test case switch

    Tets-jstransformer applies all tests to each method it can find,
    regardless of the method being asynchronous or not. This is a problem
    for tests that require a method to be asynchronous. These test cases
    should only be applied to the asynchronous methods. This commit checks
    for the text '_async' in the folder name. If it can find it, only the
    asynchronous test cases are performed. Asynchronous methods are tested
    on synchronous test cases, because that way around it should work,
    regardless of a method being asynchronous.
    
    `checkFunctionOutput` is now asynchronous. This is done, because it is
    not a given that `template.fn(locals)` returns a string. Hence this test
    case can fail because `template.fn(locals).trim()` returns an error. By
    wrapping it in a `Promise.resolve()` both the situations where
    `template.fn(locals)` returns a string or a Promise are covered. This
    is also how the jstranformer library works, so the tests now better
    mimmick the behavior of the actual library.
    gijswijs committed May 28, 2020
    Configuration menu
    Copy the full SHA
    79ada17 View commit details
    Browse the repository at this point in the history
  2. Fix linting errors

    gijswijs committed May 28, 2020
    Configuration menu
    Copy the full SHA
    32e0b47 View commit details
    Browse the repository at this point in the history