Skip to content

Commit

Permalink
integration:slow
Browse files Browse the repository at this point in the history
  • Loading branch information
tbeseda committed Apr 11, 2024
1 parent 212e517 commit 768f882
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions test/integration/commands/new-test-slow.js
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -29,20 +22,22 @@ 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}`
})

t.test(`${mode} Check for valid starter project response`, 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')
})
})

t.test(`${mode} Shut down Sandbox`, t => {
delete process.env.__SLOW__
shutdown(t)
})
}
t.end()
})

0 comments on commit 768f882

Please sign in to comment.