Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,49 @@
"taskName": "Run loopback tests",
"args": ["run", "test", "--scope", "loopback"]
},
{
"taskName": "Run loopback acceptance tests",
"args": ["run", "acceptance", "--scope", "loopback"]
},
{
"taskName": "Run loopback integration tests",
"args": ["run", "integration", "--scope", "loopback"]
},
{
"taskName": "Run loopback unit tests",
"args": ["run", "unit", "--scope", "loopback"]
},
{
"taskName": "Run juggler tests",
"args": ["run", "test", "--scope", "@loopback/juggler"]
},
{
"taskName": "Run juggler acceptance tests",
"args": ["run", "acceptance", "--scope", "@loopback/juggler"]
},
{
"taskName": "Run juggler integration tests",
"args": ["run", "integration", "--scope", "@loopback/juggler"]
},
{
"taskName": "Run juggler unit tests",
"args": ["run", "unit", "--scope", "@loopback/juggler"]
},
{
"taskName": "Run remoting tests",
"args": ["run", "test", "--scope", "@loopback/remoting"]
}
},
{
"taskName": "Run remoting acceptance tests",
"args": ["run", "acceptance", "--scope", "@loopback/remoting"]
},
{
"taskName": "Run remoting integration tests",
"args": ["run", "integration", "--scope", "@loopback/remoting"]
},
{
"taskName": "Run remoting unit tests",
"args": ["run", "unit", "--scope", "@loopback/remoting"]
},
]
}
10 changes: 5 additions & 5 deletions packages/juggler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"description": "",
"main": "index.js",
"scripts": {
"black-box": "mocha --opts ../../test/mocha.opts.black-box",
"test": "npm run white-box && npm run black-box",
"white-box": "mocha --opts ../../test/mocha.opts.white-box"
"acceptance": "mocha --opts ../../test/mocha.opts test/acceptance",

Copy link
Copy Markdown
Member

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 lerna was able to copy/link /test/mocha.opts to each subdir in packages, so that we don't have to specify --opts explicitly and can simply run mocha 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.

@superkhau superkhau Feb 3, 2017 •

Copy link
Copy Markdown
Contributor Author

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.

"integration": "mocha --opts ../../test/mocha.opts test/integration",
"test": "npm run unit && npm run integration && npm run acceptance",
"unit": "mocha --opts ../../test/mocha.opts test/unit"
},
"author": "IBM",
"license": "MIT",
"devDependencies": {
"@loopback/testlab": "^4.0.0-alpha.1",
"mocha": "^3.2.0",
"mocha-gherkin": "^0.2.0"
"mocha": "^3.2.0"
}
}
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();
});
});
7 changes: 7 additions & 0 deletions packages/juggler/test/integration/smoke.ts
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
@@ -1,6 +1,6 @@
import {expect} from '@loopback/testlab';

describe('white-box smoke test', () => {
describe('unit smoke test', () => {
it('passes', () => {
expect(true).to.be.true();
});
Expand Down
10 changes: 5 additions & 5 deletions packages/loopback/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"description": "",
"main": "index.js",
"scripts": {
"black-box": "mocha --opts ../../test/mocha.opts.black-box",
"test": "npm run white-box && npm run black-box",
"white-box": "mocha --opts ../../test/mocha.opts.white-box"
"acceptance": "mocha --opts ../../test/mocha.opts test/acceptance",
"integration": "mocha --opts ../../test/mocha.opts test/integration",
"test": "npm run unit && npm run integration && npm run acceptance",
"unit": "mocha --opts ../../test/mocha.opts test/unit"
},
"author": "IBM",
"license": "MIT",
Expand All @@ -16,7 +17,6 @@
},
"devDependencies": {
"@loopback/testlab": "^4.0.0-alpha.1",
"mocha": "^3.2.0",
"mocha-gherkin": "^0.2.0"
"mocha": "^3.2.0"
}
}
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();
}
});
});
13 changes: 13 additions & 0 deletions packages/loopback/test/acceptance/bootstrapping/feature.md
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
26 changes: 0 additions & 26 deletions packages/loopback/test/black-box/bootstrapping.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/loopback/test/black-box/crud/create/feature.md

This file was deleted.

Empty file.
12 changes: 0 additions & 12 deletions packages/loopback/test/black-box/crud/delete/feature.md

This file was deleted.

Empty file.
14 changes: 0 additions & 14 deletions packages/loopback/test/black-box/crud/read/feature.md

This file was deleted.

Empty file.
11 changes: 0 additions & 11 deletions packages/loopback/test/black-box/crud/update/feature.md

This file was deleted.

Empty file.
7 changes: 7 additions & 0 deletions packages/loopback/test/integration/smoke.ts
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();
});
});
7 changes: 7 additions & 0 deletions packages/loopback/test/unit/smoke.ts
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();
});
});
21 changes: 0 additions & 21 deletions packages/loopback/test/white-box/application.ts

This file was deleted.

12 changes: 6 additions & 6 deletions packages/remoting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"name": "@loopback/remoting",
"version": "4.0.0-alpha.1",
"description": "",
"main": "index.js",
"main": "remoting",
"scripts": {
"black-box": "mocha --opts ../../test/mocha.opts.black-box",
"test": "npm run white-box && npm run black-box",
"white-box": "mocha --opts ../../test/mocha.opts.white-box"
"acceptance": "mocha --opts ../../test/mocha.opts test/acceptance",
"integration": "mocha --opts ../../test/mocha.opts test/integration",
"test": "npm run unit && npm run integration && npm run acceptance",
"unit": "mocha --opts ../../test/mocha.opts test/unit"
},
"author": "IBM",
"license": "MIT",
"devDependencies": {
"@loopback/testlab": "^4.0.0-alpha.1",
"mocha": "^3.2.0",
"mocha-gherkin": "^0.2.0"
"mocha": "^3.2.0"
}
}
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();
});
});
7 changes: 7 additions & 0 deletions packages/remoting/test/integration/smoke.ts
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
@@ -1,6 +1,6 @@
import {expect} from '@loopback/testlab';

describe('black-box smoke test', () => {
describe('unit smoke test', () => {
it('passes', () => {
expect(true).to.be.true();
});
Expand Down
4 changes: 0 additions & 4 deletions packages/testlab/tsconfig.json

This file was deleted.

6 changes: 0 additions & 6 deletions test/global-types.d.ts

This file was deleted.

3 changes: 3 additions & 0 deletions test/mocha.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--compilers ts:tsconfig-paths/register
--recursive
--require ../../test/ts-node
4 changes: 0 additions & 4 deletions test/mocha.opts.black-box

This file was deleted.

4 changes: 0 additions & 4 deletions test/mocha.opts.white-box

This file was deleted.