test(auth) add

This commit is contained in:
coderaiser 2018-09-07 21:17:08 +03:00
parent a2efcadd55
commit 2aadc16218
2 changed files with 30 additions and 0 deletions

View file

@ -182,6 +182,7 @@
"extract-text-webpack-plugin": "^4.0.0-alpha.0",
"fast-async": "^7.0.6",
"file-loader": "^2.0.0",
"got": "^9.2.1",
"gritty": "^3.0.1",
"gunzip-maybe": "^1.3.1",
"html-looks-like": "^1.0.2",

29
server/auth.spec.js Normal file
View file

@ -0,0 +1,29 @@
'use strict';
const test = require('tape');
const diff = require('sinon-called-with-diff');
const sinon = diff(require('sinon'));
const ky = require('ky');
const {connect} = require('../test/before');
const authPath = './auth';
test.only('config: manage: get', async (t) => {
const auth = false;
const config = {
auth,
};
const {done} = await connect({
config,
});
const [, result] = await ky.get('/dist/sw.js');
await done();
t.ok(result, 'should return service worker file without an auth');
t.end();
});