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

Replace practicalmeteor:mocha with meteortesting:mocha #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions source/chapters/3/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ This article assumes you thoroughly read: https://guide.meteor.com/testing.html
If you decoupled your code nicely, it's so easy to write tests:

```
meteor add practicalmeteor:mocha
meteor npm i --save-dev chai sinon
meteor add meteortesting:mocha
meteor npm i --save-dev expect
```

```
// package.json
{
"scripts": {
"test": "meteor test --driver-package practicalmeteor:mocha --port 3050"
"test": "meteor test --driver-package meteortesting:mocha --port 3050"
}
}
```
Expand All @@ -39,14 +39,14 @@ depending where we want to run them.
```js
// file: /imports/api/posts/testing/server/PostService.test.js

import {assert} from 'chai';
import expect from 'expect';
import PostService from '/imports/api/posts/services/PostService';

describe('Post Service', function () {
it('Should be able to create a post', function () {
const postId = PostService.createPost({title: 'Hello'})

assert.isString(postId);
expect(typeof postId).toBe("string")
})
})
```
Expand Down