-
Notifications
You must be signed in to change notification settings - Fork 914
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
Feature/e2e-testing #42
Conversation
@@ -343,7 +339,7 @@ export class CreateUsers implements SeedsInterface { | |||
public async seed(factory: FactoryInterface): Promise<any> { | |||
await factory | |||
.get(User, 'admin') | |||
.create(1); | |||
.create(); |
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.
It would be nice when we could use create(10)
and create()
so we don't need an additional method createMany(x)
.
package-scripts.js
Outdated
'nps test.e2e.pretest', | ||
'nps test.e2e.run' | ||
), | ||
pretest: 'tslint -c ./tslint.json -t stylish ./test/e2e/**/*.ts', |
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.
Can we refactor this command to be more generic and pass a parameter ./test/e2e/**/*.ts
so we can centralise the tslint logic.
@@ -1,10 +1,14 @@ | |||
import { FactoryInterface } from './FactoryInterface'; |
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.
Refactor file name to SeedInterfaces.ts
as the file exports more than one.
test/e2e/api/users.test.ts
Outdated
describe('/api/users', () => { | ||
|
||
// ------------------------------------------------------------------------- | ||
// Tear up |
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.
Thats called Setup up
.
test/e2e/utils/typeormLoader.ts
Outdated
@@ -0,0 +1,15 @@ | |||
import { createDatabaseConnection } from './../../integration/utils/database'; |
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.
Probably we should isolate integration tests from e2d tests?
test/e2e/api/info.test.ts
Outdated
@@ -0,0 +1,38 @@ | |||
import { Application } from 'express'; |
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.
I think it's unused. Please fix your tslint or ts => https://palantir.github.io/tslint/rules/no-unused-variable/
test/e2e/api/users.test.ts
Outdated
@@ -0,0 +1,66 @@ | |||
import * as nock from 'nock'; | |||
import * as request from 'supertest'; | |||
import { Application } from 'express'; |
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.
I think it's unused. Please fix your tslint or ts => https://palantir.github.io/tslint/rules/no-unused-variable/
test/e2e/utils/bootstrap.ts
Outdated
import { monitorLoader } from './../../../src/loaders/monitorLoader'; | ||
import { homeLoader } from './../../../src/loaders/homeLoader'; | ||
import { typeormLoader } from '../utils/typeormLoader'; | ||
import { publicLoader } from './../../../src/loaders/publicLoader'; |
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.
I think it's unused. Please fix your tslint or ts => https://palantir.github.io/tslint/rules/no-unused-variable/
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.
Please check the whole file
test/e2e/utils/bootstrap.ts
Outdated
import { monitorLoader } from './../../../src/loaders/monitorLoader'; | ||
import { homeLoader } from './../../../src/loaders/homeLoader'; | ||
import { typeormLoader } from '../utils/typeormLoader'; | ||
import { publicLoader } from './../../../src/loaders/publicLoader'; |
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.
Please check the whole file
test/e2e/utils/typeormLoader.ts
Outdated
import { Connection } from 'typeorm/connection/Connection'; | ||
import { createConnection } from 'typeorm'; | ||
import { MicroframeworkSettings, MicroframeworkLoader } from 'microframework-w3tec'; | ||
import { env } from '../../../src/core/env'; |
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.
I think it's unused. Please fix your tslint or ts => https://palantir.github.io/tslint/rules/no-unused-variable/
No description provided.