Files
shields/services/github/github-size.tester.js
Paul Melnikow 4bd16f93e8 Sort imports and requires (#3056)
This will definitely save time, and ensure more uniformity.

It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.

Closes #2701
2019-02-21 22:14:40 -05:00

18 lines
624 B
JavaScript

'use strict'
const Joi = require('joi')
const { isFileSize } = require('../test-validators')
const t = (module.exports = require('../tester').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' })