You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+56-27Lines changed: 56 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,33 +7,37 @@
7
7
8
8
This is a [Helper](https://codecept.io/helpers/) for [CodeceptJS](https://codecept.io/) that allows you to execute queries or commands to databases using [database-js](https://github.com/mlaanderson/database-js). That is, your tests written for CodeceptJS now will be able to access databases easily. **It is especially useful for preparing databases before/after executing test cases.**
9
9
10
+
👉 It works with **CodeceptJS 1, 2, and 3**.
11
+
10
12
## Install
11
13
12
-
**_Step 1 of 2_: Install the helper**
14
+
> You have to install the library and the desired database drivers
15
+
16
+
Step 1 of 2: **Install the helper**
13
17
14
18
```bash
15
-
npm install --save codeceptjs-dbhelper
19
+
npm i -D codeceptjs-dbhelper
16
20
```
17
21
18
-
**_Step 2 of 2_: Install the driver for the database you need to use**
See the [CodeceptJS docs](https://github.com/codeceptjs/CodeceptJS/wiki/Upgrading-to-CodeceptJS-3) for more information on how to upgrade your codebase.
79
+
52
80
### Examples
53
81
54
-
The object `I` of your tests and events will have access to new methods. [See the API](#api).
82
+
> The following examples are written with **CodeceptJS 3**.
83
+
84
+
The object `I` of your tests and events now has to the [methods described in the API](#api).
55
85
56
86
#### Example 1
57
87
58
88
```js
59
-
BeforeSuite( async( I ) => {
89
+
BeforeSuite( async( { I } ) => {
60
90
// The first parameter is the key that will hold a reference to the db
0 commit comments