uppy/test/mocks/acquirerPlugin2.js
Rich Willars 540c02b6b0 Add jest tests
Adds tests for src/core/Utils

Ports translator tests to jest

Adds tests for core/index

Added code coverage report

Adds tests for core/UppySocket

Adds tests to src/core and cleanup of test directory

Switched from import to require as the project supports node v4

Runs tests using Babel for backwards compatibilty

Adds src/core state tests

Adds src/core reset & close tests

Updates stagnant snapshot

Adds tests for preprocessors and postprocessors in src/core/Core.js

Adds tests for uploaders and metadata in src/core/Core

Adds tests for adding and removing files in src/core/Core

Adds test for getFile
2017-09-08 17:18:58 +01:00

34 lines
652 B
JavaScript

import Plugin from '../../src/plugins/Plugin.js'
export default class TestSelector2 extends Plugin {
constructor (core, opts) {
super(core, opts)
this.type = 'acquirer'
this.id = 'TestSelector2'
this.name = this.constructor.name
this.mocks = {
run: jest.fn(),
update: jest.fn(),
uninstall: jest.fn()
}
}
run (results) {
this.core.log({
class: this.constructor.name,
method: 'run',
results: results
})
this.mocks.run(results)
return Promise.resolve('success')
}
update (state) {
this.mocks.update(state)
}
uninstall () {
this.mocks.uninstall()
}
}