Skip to content

Commit

Permalink
Added basic mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-ed-raffalli committed Mar 21, 2018
1 parent ac34de1 commit 9fbbc9d
Show file tree
Hide file tree
Showing 18 changed files with 6,164 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
44 changes: 44 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"extends": [
"eslint:recommended"
],
"env": {
"browser": false,
"node": true,
"mocha": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"quote-props": [
"error",
"as-needed"
],
"semi": [
"error",
"always"
],
"comma-dangle": [
"error",
"never"
]
}
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.idea

.nyc_output
coverage

node_modules
*.log
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# lb-api-test


### Test


### Expect

#### Status only test

```js
{
expect: 200
}
```

#### Object test

```js
{
expect: {
status: 200,
body: {
expected: 'value'
}
}
}
```

#### Response custom test

```js
{
expect: response => {
// custom expect here
}
}
```

#### Body custom test

```js
{
expect: {
body: response => {
// custom expect here
}
}
}
```
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

const TestRunner = require('./src/TestRunner');

module.exports = (app, config, testSuiteDefinition) => {
new TestRunner(config)
.run(app, testSuiteDefinition);
};
3 changes: 3 additions & 0 deletions mocha.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
./src/**/*.test.js
--recursive
--check-leaks
Loading

0 comments on commit 9fbbc9d

Please sign in to comment.