test/errors/sync/index.test.jsView |
---|
4 | 4 | const isPositionLateError = require('../../../errors/sync/isPositionLateError')() |
5 | 5 | const isPositionTypeError = require('../../../errors/sync/isPositionTypeError')() |
6 | 6 | |
7 | 7 | const positionTypeError = require('../../../errors/sync/positionTypeError') |
8 | | -const positionLateError = require('../../../errors/sync/positionLateError') |
9 | | -const positionChoiceError = require('../../../errors/sync/positionChoiceError') |
| 8 | +const PositionLateError = require('../../../errors/sync/positionLateError') |
| 9 | +const PositionChoiceError = require('../../../errors/sync/positionChoiceError') |
10 | 10 | |
11 | 11 | const ChooseOne = require('../../../position/sync/chooseOne') |
12 | 12 | |
13 | 13 | test('positionTypeError', function (t) { |
27 | 27 | var validPosition = ChooseOne({ |
28 | 28 | poll: '%t+PhrNxxXkw/jMo6mnwUWfFjJapoPWxzsQoe0Np+nYw=.sha256', |
29 | 29 | choice: 0 |
30 | 30 | }) |
31 | | - var invalidError = positionLateError({}) |
| 31 | + var invalidError = PositionLateError({}) |
32 | 32 | t.false(isPositionTypeError(invalidError), 'catches invalid error') |
33 | 33 | |
34 | | - var validError = positionLateError({position: validPosition}) |
| 34 | + var validError = PositionLateError({position: validPosition}) |
35 | 35 | t.true(isPositionLateError(validError), 'validates valid error') |
36 | 36 | t.end() |
37 | 37 | }) |
38 | 38 | |
40 | 40 | var validPosition = ChooseOne({ |
41 | 41 | poll: '%t+PhrNxxXkw/jMo6mnwUWfFjJapoPWxzsQoe0Np+nYw=.sha256', |
42 | 42 | choice: 0 |
43 | 43 | }) |
44 | | - var invalidError = positionChoiceError({}) |
| 44 | + var invalidError = PositionChoiceError({}) |
45 | 45 | t.false(isPositionChoiceError(invalidError), 'catches invalid error') |
46 | 46 | |
47 | | - var validError = positionChoiceError({position: validPosition}) |
| 47 | + var validError = PositionChoiceError({position: validPosition}) |
48 | 48 | t.true(isPositionChoiceError(validError), 'validates valid error') |
49 | 49 | t.end() |
50 | 50 | }) |