From 2aadc1621860043673ae3f2db4a632798b8bdf24 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 7 Sep 2018 21:17:08 +0300 Subject: [PATCH] test(auth) add --- package.json | 1 + server/auth.spec.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 server/auth.spec.js diff --git a/package.json b/package.json index 4cec1215..6c696f43 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/server/auth.spec.js b/server/auth.spec.js new file mode 100644 index 00000000..23fe81bd --- /dev/null +++ b/server/auth.spec.js @@ -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(); +}); +