Fix tests

This commit is contained in:
Kevin van Zonneveld 2016-02-21 17:00:00 +01:00
parent 39040c15f6
commit e4e80931ba
3 changed files with 8 additions and 6 deletions

View file

@ -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. '

View file

@ -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) {

View file

@ -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) {