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: make plugins/development test stable #5211

Merged
merged 2 commits into from
Jun 15, 2023
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: 0 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '25 5 * * 6'

jobs:
analyze:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ on:
pull_request:
branches: [ master, 2.x, 1.x ]

workflow_dispatch: {}

jobs:
Job:
name: Node.js
uses: artusjs/github-actions/.github/workflows/node-test.yml@master
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
with:
os: 'ubuntu-latest, macos-latest, windows-latest'
version: '14, 16, 18, 20'
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ on:
push:
branches: [ master, 2.x, 1.x ]

workflow_dispatch: {}

jobs:
release:
name: Node.js
uses: artusjs/github-actions/.github/workflows/node-release.yml@master
uses: node-modules/github-actions/.github/workflows/node-release.yml@master
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
Expand Down
26 changes: 9 additions & 17 deletions test/lib/plugins/development.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
'use strict';

const fs = require('fs');
const path = require('path');
const pedding = require('pedding');
const mm = require('egg-mock');
const utils = require('../../utils');

Expand All @@ -19,30 +16,25 @@ describe('test/lib/plugins/development.test.js', () => {
});
after(() => app.close());

it('should ignore assets', done => {
done = pedding(4, done);
it('should ignore assets', async () => {
mm(app.logger, 'info', msg => {
if (msg.match(/status /)) {
throw new Error('should not log status');
}
});

app.httpRequest()
await app.httpRequest()
.get('/foo.js')
.expect(200)
.end(done);
.expect(200);

app.httpRequest()
.get('/public/hello')
.expect(404, done);
await app.httpRequest()
.get('/public/hello');

app.httpRequest()
.get('/assets/hello')
.expect(404, done);
await app.httpRequest()
.get('/assets/hello');

app.httpRequest()
.get('/__koa_mock_scene_toolbox/hello')
.expect(404, done);
await app.httpRequest()
.get('/__koa_mock_scene_toolbox/hello');
});
});

Expand Down