Continue to implement #2698: - Add `core/base-service/index.js` (but hold off on moving the things it imports) - Add shortcuts in `services/index.js` for Base*Service, errors, and deprecatedService. This file will be streamlined later to avoid cluttering it with rarely used bits. - Apply consistent ordering of imports and use of `module.exports` in testers. - Remove some renaming of imports. - Remove obsolete tests here and there.
19 lines
618 B
JavaScript
19 lines
618 B
JavaScript
'use strict'
|
|
|
|
const Joi = require('joi')
|
|
const { isFileSize } = require('../test-validators')
|
|
|
|
const t = (module.exports = require('..').createServiceTester())
|
|
|
|
t.create('File size')
|
|
.get('/webcaetano/craft/build/phaser-craft.min.js.json')
|
|
.expectJSONTypes(Joi.object().keys({ name: 'size', value: isFileSize }))
|
|
|
|
t.create('File size 404')
|
|
.get('/webcaetano/craft/build/does-not-exist.min.js.json')
|
|
.expectJSON({ name: 'size', value: 'repo or file not found' })
|
|
|
|
t.create('File size for "not a regular file"')
|
|
.get('/webcaetano/craft/build.json')
|
|
.expectJSON({ name: 'size', value: 'not a regular file' })
|