-
Notifications
You must be signed in to change notification settings - Fork 208
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
Conversation
@@ -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\"", |
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.
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
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.
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.
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.
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"]
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.
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
.
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.
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?
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.
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?
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.
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
Signed-off-by: Diana Lau <[email protected]>
See #84 |
@raymondfeng , looks like ur PR #84 has already covered what I'm planning to do, so I'm going to abandon this PR. Thanks. |
Implements #68
Similar PR https://github.com/strongloop/loopback-next/pull/2316/files