From 768f8825e5ff6676575c15e7c33790683eee93cb Mon Sep 17 00:00:00 2001 From: Taylor Beseda Date: Thu, 11 Apr 2024 12:16:21 -0600 Subject: [PATCH] integration:slow --- test/integration/commands/new-test-slow.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/test/integration/commands/new-test-slow.js b/test/integration/commands/new-test-slow.js index 8df9d8e..dafcdbb 100644 --- a/test/integration/commands/new-test-slow.js +++ b/test/integration/commands/new-test-slow.js @@ -1,17 +1,10 @@ let test = require('tape') -let { join } = require('path') let tiny = require('tiny-json-http') -let lib = join(process.cwd(), 'test', 'lib') -let { begin: _begin, newTmpFolder, run, start, shutdown } = require(lib) +let { begin: _begin, newTmpFolder, start, shutdown } = require('../../lib') test('Run new tests (slow)', async t => { - await run(runTests, t) - t.end() -}) - -async function runTests (runType, t) { - let mode = `[New / ${runType} (slow)]` - let begin = _begin[runType].bind({}, t) + let mode = `[New (slow)]` + let begin = _begin.bind({}, t) let newAppDir = 'new' let installing = /Installing dependencies/ @@ -29,7 +22,7 @@ async function runTests (runType, t) { }) t.test(`${mode} Start Begin dev`, async t => { - let port = await start[runType](t, cwd) + let port = await start(t, cwd) url = `http://localhost:${port}` }) @@ -37,7 +30,7 @@ async function runTests (runType, t) { t.plan(1) tiny.get({ url }, function _got (err, result) { if (err) t.fail(err) - else t.ok(result.body.includes('https://enhance.dev'), 'Got valid Enhance starter project response') + else t.ok(result?.body.includes('https://enhance.dev'), 'Got valid Enhance starter project response') }) }) @@ -45,4 +38,6 @@ async function runTests (runType, t) { delete process.env.__SLOW__ shutdown(t) }) -} + t.end() +}) +