Skip to content
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

refactor: move test files to src/__tests__ #82

Closed
wants to merge 1 commit into from
Closed

Conversation

dhmlau
Copy link
Member

@dhmlau dhmlau commented Apr 16, 2019

@@ -28,10 +28,10 @@
"tslint:fix": "npm run tslint -- --fix",
"pretest": "npm run clean && npm run build && npm run docker:start",
"pretest:ci": "npm run build",
"test": "lb-mocha --allow-console-logs \"dist/test\"",
"test:ci": "lb-mocha --allow-console-logs \"dist/test\"",
"test": "lb-mocha --allow-console-logs \"dist/src/__tests__/**/*.js\"",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the similar PR loopbackio/loopback-next#2316, it references dist/__tests__/**/*.js without the src folder in the path, but somehow I cannot get it to work in here.
cc @b-admike

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So with your current changes, in the dist folder, it currently contains two folders: src and recommender. In the PR you referenced, in tsconfig.build.json, this change is made:

"compilerOptions": {
-   "rootDir": "."
+   "rootDir": "src"
},

Now all the files that were originally in the src folder are now the ones in the dist folder. The problem is that if you try to do that here, then it won't include the recommender folder.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right. that's the problem we're having now. Tried below but still have the same error that "no test files found in dist/tests/**/*.js".

    "rootDirs": ["src", "recommender"]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have more than one directories, they will be created under dist. We need to either make this repo a monorepo or refactor recommender into src.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the original intent of putting recommender folder outside src because it's not part of the LB application? If our ultimate goal is to make this repo a monorepo where each "component" as separate microservices, maybe we'd go for the monorepo option?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussing it with @b-admike, I changed my mind. Putting everything into src might be a simpler solution, and we can make this as the monorepo when we're going to make each component as microservices.

@strongloop/loopback-maintainers, thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting everything into src might be a simpler solution, and we can make this as the monorepo when we're going to make each component as microservices.

+1

@raymondfeng
Copy link
Contributor

See #84

@dhmlau
Copy link
Member Author

dhmlau commented Apr 22, 2019

@raymondfeng , looks like ur PR #84 has already covered what I'm planning to do, so I'm going to abandon this PR. Thanks.

@dhmlau dhmlau closed this Apr 22, 2019
@bajtos bajtos deleted the refactor-test branch May 3, 2019 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants