mirror of
https://github.com/zhigang1992/probot.git
synced 2026-06-15 18:37:42 +08:00
Stop using the names 'plugin' and 'app' to refer to instances of ApplicationFunction. This renames all variable names, but leaves the plugins folder in place, to be renamed later
19 lines
518 B
JavaScript
19 lines
518 B
JavaScript
const {resolve} = require('../src/resolver')
|
|
|
|
const stubAppFnPath = require.resolve('./fixtures/plugin/stub-plugin')
|
|
const basedir = process.cwd()
|
|
|
|
describe('resolver', () => {
|
|
let stubResolver
|
|
|
|
beforeEach(() => {
|
|
stubResolver = jest.fn().mockReturnValue(stubAppFnPath)
|
|
})
|
|
|
|
it('loads the module at the resolved path', () => {
|
|
const module = resolve('foo', {resolver: stubResolver})
|
|
expect(module).toBe(require(stubAppFnPath))
|
|
expect(stubResolver).toHaveBeenCalledWith('foo', {basedir})
|
|
})
|
|
})
|