Repository navigation
Refactor test setup #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import {expect} from '@loopback/testlab'; | ||
|
|
||
| suite('white-box smoke test', () => { | ||
| test('passes', () => { | ||
| describe('acceptance smoke test', () => { | ||
| it('passes', () => { | ||
| expect(true).to.be.true(); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import {expect} from '@loopback/testlab'; | ||
|
|
||
| describe('integration smoke test', () => { | ||
| it('passes', () => { | ||
| expect(true).to.be.true(); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import {expect} from '@loopback/testlab'; | ||
| import * as util from 'loopback/test/support/util'; | ||
|
|
||
| describe('bootstrapping the application', () => { | ||
| describe('with default configs', () => { | ||
| let app; | ||
| let client; | ||
| before(createApp); | ||
| before(createClient); | ||
| before(startApp); | ||
|
|
||
| context('GET /', () => { | ||
| let response; | ||
| before(makeRequest); | ||
|
|
||
| it('responds with HTTP 200', async () => { | ||
| expect(response.statusCode).to.equal(200); | ||
| }); | ||
|
|
||
| async function makeRequest() { | ||
| response = await client.get('/') | ||
| } | ||
| }); | ||
|
|
||
| function createApp() { | ||
| app = util.createApp(); | ||
| } | ||
| function createClient() { | ||
| client = util.createClient(app); | ||
| } | ||
| async function startApp() { | ||
| await app.start(); | ||
| } | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Feature: Bootstrapping the application | ||
|
|
||
| - In order to serve up my API | ||
| - As a user | ||
| - I want to start the application | ||
|
|
||
| ## Scenario: with default configs | ||
|
|
||
| - Given an application | ||
| - And a client | ||
| - When I start the application | ||
| - And I send a request to GET / from the client | ||
| - Then the application responds with HTTP 200 |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import {expect} from '@loopback/testlab'; | ||
|
|
||
| describe('integration smoke test', () => { | ||
| it('passes', () => { | ||
| expect(true).to.be.true(); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import {expect} from '@loopback/testlab'; | ||
|
|
||
| describe('unit smoke test', () => { | ||
| it('passes', () => { | ||
| expect(true).to.be.true(); | ||
| }); | ||
| }); |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import {expect} from '@loopback/testlab'; | ||
|
|
||
| suite('white-box smoke test', () => { | ||
| test('passes', () => { | ||
| describe('acceptance smoke test', () => { | ||
| it('passes', () => { | ||
| expect(true).to.be.true(); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import {expect} from '@loopback/testlab'; | ||
|
|
||
| describe('integration smoke test', () => { | ||
| it('passes', () => { | ||
| expect(true).to.be.true(); | ||
| }); | ||
| }); |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| --compilers ts:tsconfig-paths/register | ||
| --recursive | ||
| --require ../../test/ts-node |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, it would be great if
lernawas able to copy/link/test/mocha.optsto each subdir inpackages, so that we don't have to specify--optsexplicitly and can simply runmocha test/unit/my-test-file.ts(I do that quite often).This is out of scope of this pull request though, and most likely requires an enhancement to be contributed to lerna.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bajtos I was hoping for that too -- couldn't find a way OOB though. ;( I have one hacky idea in my head, but haven't tried it yet because I figure we have bigger 🐟 to fry ATM.