0.1.2 • Published 5 years ago

@lt-mayonesa/judo v0.1.2

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Judo

Build Status David

SQL Stored Procedures Testing Made SIMPLE

INSERT EPIC INTRODUCTION HERE

Scenario: calculate monthly summary for one user with several expenses

    Given a table transactions
      | user  | amount | concept   | createdAt  |
      | john  | 100    | food      | 2019-06-10 |
      | john  | 50     | clothing  | 2019-06-10 |
      | john  | 10     | food      | 2019-06-10 |
      | clair | 200    | transport | 2019-06-10 |
      | clair | 50     | food      | 2019-06-10 |
    
    When I execute monthly_expenses
    
    Then summary should have
      | user  | month | total |
      | john  | 6     | 160   |
      | clair | 6     | 250   |

Supported Engines

MSSQLMySQLOraclePostgreSQL
YESNONONO

Currently Judo can only be used with MSSQL, it's in my intentions to add support for other SQL engines.

Install

$ npm install @lt-mayonesa/judo

Important: judo will not work as a global package as it depends on cucumber (see cucumber-js/issues/908)

Usage

Judo is based on Cucumber's runtime but all the steps necessary are already implemented. The only thing you need to do is define your Judo Features (.feature files in gherkin syntax) using our available steps and execute Judo.

By default Judo runs against a SQL Server's master database running on localhost:1433

  1. Create .feature files.
  2. Run:
    $ npx judo [features_dir]
    # OR directly node_modules
    $ ./node_modules/.bin/judo

Configuration

SQL Connection

There are several ways to override the config properties: using ENV_VARS, CLI args, or a CommonJS config file.

defaultenv variablescli argssql.conf.js
user'sa'SQL_USERsql.useruser
password'Password01'SQL_PASSWORDsql.passwordpassword
server'localhost'SQL_SERVERsql.serverserver
port1433SQL_PORTsql.portport
database'master'SQL_DATABASEsql.databasedatabase

Sandbox

By default every scenario is run inside a TRANSACTION, which is rolled back at the end. If we want to persist the changes we can tell Judo that is running against a "sandbox" environment.

$ npx judo [features_dir] --judo.sandbox

Examples

See docs/examples directory

Available Steps:

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago