mirror of
https://github.com/zhigang1992/probot.git
synced 2026-06-15 10:27:43 +08:00
BREAKING CHANGE: `probot run` without any arguments will no longer autoload apps named `probot-*`.
22 lines
614 B
JavaScript
22 lines
614 B
JavaScript
/* eslint prefer-arrow-callback: off */
|
|
|
|
const expect = require('expect')
|
|
const resolve = require('../lib/resolver')
|
|
|
|
const stubPluginPath = require.resolve('./fixtures/plugin/stub-plugin')
|
|
const basedir = process.cwd()
|
|
|
|
describe('resolver', function () {
|
|
let stubResolver
|
|
|
|
beforeEach(function () {
|
|
stubResolver = expect.createSpy().andReturn(stubPluginPath)
|
|
})
|
|
|
|
it('loads the module at the resolved path', function () {
|
|
const module = resolve('foo', {resolver: stubResolver})
|
|
expect(module).toBe(require(stubPluginPath))
|
|
expect(stubResolver).toHaveBeenCalledWith('foo', {basedir})
|
|
})
|
|
})
|