mirror of
https://github.com/transloadit/uppy.git
synced 2026-01-23 10:25:33 +00:00
Fix tests
This commit is contained in:
parent
39040c15f6
commit
e4e80931ba
3 changed files with 8 additions and 6 deletions
|
|
@ -48,7 +48,7 @@ export default class Core {
|
|||
const plugin = new Plugin(this, opts)
|
||||
this.plugins[plugin.type] = this.plugins[plugin.type] || []
|
||||
|
||||
if (!plugin.name) {
|
||||
if (!plugin.constructor.name) {
|
||||
throw new Error('Your plugin must have a name')
|
||||
}
|
||||
if (!plugin.type) {
|
||||
|
|
@ -57,7 +57,9 @@ export default class Core {
|
|||
|
||||
let existsPluginAlready = this.getPlugin(plugin.constructor.name)
|
||||
if (existsPluginAlready) {
|
||||
let msg = 'Uppy is currently limited to running one of every plugin. '
|
||||
let msg = `Already found a plugin named '${existsPluginAlready.name}'. `
|
||||
msg += `Tried to use: '${plugin.constructor.name}'. `
|
||||
msg += 'Uppy is currently limited to running one of every plugin. '
|
||||
msg += 'Share your use case with us over at '
|
||||
msg += 'https://github.com/transloadit/uppy/issues/ '
|
||||
msg += 'if you want us to reconsider. '
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
const Plugin = require('../../src/plugins/Plugin.js')
|
||||
|
||||
export default class TestSelector extends Plugin {
|
||||
export default class TestSelector1 extends Plugin {
|
||||
constructor (core, opts) {
|
||||
super(core, opts)
|
||||
this.type = 'selecter'
|
||||
this.name = 'selecter1'
|
||||
this.name = this.constructor.name
|
||||
}
|
||||
|
||||
run (results) {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
const Plugin = require('../../src/plugins/Plugin.js')
|
||||
|
||||
export default class TestSelector extends Plugin {
|
||||
export default class TestSelector2 extends Plugin {
|
||||
constructor (core, opts) {
|
||||
super(core, opts)
|
||||
this.type = 'selecter'
|
||||
this.name = 'selecter2'
|
||||
this.name = this.constructor.name
|
||||
}
|
||||
|
||||
run (results) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue