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

test: upgrade dependencies #11

Merged
merged 3 commits into from
Oct 12, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ install:
test_script:
- node --version
- npm --version
- npm run ci
- npm run test

build: off
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@
"plugin"
],
"dependencies": {
"debug": "^2.6.0",
"moment": "^2.17.1",
"mz": "^2.6.0"
"debug": "^3.1.0",
"moment": "^2.19.0",
"mz": "^2.7.0"
},
"files": [
"agent.js",
"app",
"config",
"agent.js",
"app.js"
],
"devDependencies": {
"autod": "^2.7.1",
"egg": "^0.9.0",
"egg-bin": "^2.0.2",
"egg-ci": "^1.1.0",
"egg-mock": "^2.3.1",
"eslint": "^3.14.1",
"eslint-config-egg": "^3.2.0",
"glob": "^7.1.1",
"autod": "^2.9.0",
"egg": "^1.9.0",
"egg-bin": "^4.3.5",
"egg-ci": "^1.8.0",
"egg-mock": "^3.13.0",
"eslint": "^4.8.0",
"eslint-config-egg": "^5.1.1",
"glob": "^7.1.2",
"pedding": "1",
"supertest": "^3.0.0"
},
Expand All @@ -40,10 +40,11 @@
},
"scripts": {
"lint": "eslint .",
"test": "npm run lint -- --fix && npm run test-local",
"pkgfiles": "egg-bin pkgfiles",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉这句不要加了,直接在下面 2 个地方加上就好了。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没关系吧

Copy link
Member

@atian25 atian25 Oct 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,都行。合了发版本吧。

"test": "npm run lint -- --fix && npm run pkgfiles && npm run test-local",
"test-local": "egg-bin test",
"cov": "egg-bin cov",
"ci": "npm run lint && npm run cov",
"ci": "npm run lint && npm run pkgfiles -- --check && npm run cov",
"autod": "autod"
},
"ci": {
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/logger-reload/config/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

exports.keys = 'test key';
28 changes: 12 additions & 16 deletions test/logrotator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ describe('test/logrotator.test.js', () => {
describe('rotate_by_day', () => {

let app;
before(() => {
beforeEach(() => {
app = mm.app({
baseDir: 'logrotator-app',
cache: false,
});
return app.ready();
});
after(() => app.close());
afterEach(() => app.close());
afterEach(mm.restore);

const schedule = path.join(__dirname, '../app/schedule/rotate_by_file');
Expand Down Expand Up @@ -71,7 +71,6 @@ describe('test/logrotator.test.js', () => {

// run again should work
yield app.runSchedule(schedule);

});

it('should error when rename to existed file', function* () {
Expand All @@ -85,8 +84,6 @@ describe('test/logrotator.test.js', () => {
msg = err.message;
});
yield app.runSchedule(schedule);
fs.unlinkSync(file1);
fs.unlinkSync(file2);
assert(msg === `[egg-logrotator] rename ${file1}, found exception: targetFile ${file2} exists!!!`);
});

Expand Down Expand Up @@ -219,18 +216,18 @@ describe('test/logrotator.test.js', () => {
// logging to files
before(() => {
return request(app.callback())
.get('/log')
.expect({
method: 'GET',
path: '/log',
})
.expect(200);
.get('/log')
.expect({
method: 'GET',
path: '/log',
})
.expect(200);
});
// start rotating
before(() => {
return request(app.callback())
.get('/rotate')
.expect(200);
.get('/rotate')
.expect(200);
});

after(() => app.close());
Expand All @@ -252,16 +249,15 @@ describe('test/logrotator.test.js', () => {
assert(/agent warn/.test(content3));

yield request(app.callback())
.get('/log')
.expect(200);
.get('/log')
.expect(200);

// will logging to new file
const content4 = fs.readFileSync(logfile1, 'utf8');
assert(/GET \//.test(content4));
});
});


describe('rotate_by_hour', () => {

let app;
Expand Down