Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6dc0af3
commit c9fb3fb
Showing
18 changed files
with
99 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
preset: 'ts-jest', | ||
testPathIgnorePatterns: ['<rootDir>/test/fixtures'], | ||
coveragePathIgnorePatterns: ['<rootDir>/test/'], | ||
setupFilesAfterEnv: [path.join(__dirname, 'test/.setup.js')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const path = require('path'); | ||
process.env.MIDWAY_TS_MODE = 'true'; | ||
process.env.MIDWAY_EGG_PLUGIN_PATH = path.join(__dirname, '../../../'); | ||
jest.setTimeout(30000); |
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
packages/midway-schedule/test/fixtures/worker-other/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "worker-other", | ||
"scripts": { | ||
"build": "midway-bin build -c" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/midway-schedule/test/fixtures/worker-other/src/app/schedule/hello.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
let i = 1; | ||
|
||
exports.task = async (ctx) => { | ||
console.log('hasdf'); | ||
ctx.logger.info(process.pid, 'hehehehe', i++); | ||
}; | ||
|
||
exports.schedule = { | ||
type: 'worker', | ||
interval: 1000, | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/midway-schedule/test/fixtures/worker-other/src/config/plugin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exports.logrotator = true; |
12 changes: 12 additions & 0 deletions
12
packages/midway-schedule/test/fixtures/worker-other/src/schedule/interval.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Provide, Schedule, CommonSchedule } from '@midwayjs/decorator'; | ||
|
||
@Provide() | ||
@Schedule({ | ||
type: 'worker', | ||
interval: 1000, | ||
}) | ||
export default class IntervalCron implements CommonSchedule { | ||
async exec(ctx) { | ||
ctx.logger.info(process.pid, 'hello decorator'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { IMidwayWebConfigurationOptions, Framework } from '../../web/src'; | ||
import { join } from 'path'; | ||
import { createApp, close } from '@midwayjs/mock'; | ||
|
||
export async function create(name, options: IMidwayWebConfigurationOptions = {}) { | ||
const baseDir = join(__dirname, 'fixtures', name); | ||
return createApp<Framework>(baseDir, options, Framework) | ||
} | ||
|
||
export async function closeApp(app) { | ||
await close(app); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/web/src/app/extend/context.ts → packages/web/app/extend/context.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/web/src/config/config.default.ts → packages/web/config/config.default.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
static: false, | ||
development: false, | ||
watcher: false, | ||
schedulePlus: { | ||
enable: true, | ||
package: 'midway-schedule', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.