Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 committed Nov 23, 2017
1 parent 3b12317 commit b4ef4c1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
9 changes: 0 additions & 9 deletions docs/source/en/intro/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,21 +433,12 @@ All the test files should place at `{app_root}/test/**/*.test.js`.
const { app, mock, assert } = require('egg-mock/bootstrap');

describe('test/app/middleware/robot.test.js', () => {
before(() => {
app = mock.app();
return app.ready();
});

afterEach(mock.restore);

it('should block robot', () => {
return app.httpRequest()
.get('/')
.set('User-Agent', "Baiduspider")
.expect(403);
});

// ...
});
```

Expand Down
11 changes: 0 additions & 11 deletions docs/source/zh-cn/intro/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,23 +406,12 @@ module.exports = SomeService;
const { app, mock, assert } = require('egg-mock/bootstrap');

describe('test/app/middleware/robot.test.js', () => {
before(() => {
// 创建当前应用的 app 实例
app = mock.app();
// 等待 app 启动成功,才能执行测试用例
return app.ready();
});

afterEach(mock.restore);

it('should block robot', () => {
return app.httpRequest()
.get('/')
.set('User-Agent', "Baiduspider")
.expect(403);
});

// ...
});
```

Expand Down

0 comments on commit b4ef4c1

Please sign in to comment.