-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add CI & tests #3
Conversation
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 address the comments.
And the comments message of ddbba21
should be Expose the db port for testing in Travis
.
README.md
Outdated
``` bash | ||
./run_test.sh | ||
``` | ||
|
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 use Makefile as entry point instead of shell script.
__mocks__/ipfs-api.js
Outdated
mockFiles = files; | ||
}, | ||
files: { | ||
cat: jest.fn().mockImplementation(path => Promise.resolve(mockFiles[path])), |
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.
Our prettierrc is "arrowParens": "always",
__tests__/integration/api/api.js
Outdated
@@ -0,0 +1,10 @@ | |||
const axios = require('axios'); | |||
// import axios from 'axios'; |
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.
Remove this comment.
__tests__/integration/api/api.js
Outdated
const port = process.env.PORT || 3000; | ||
|
||
module.exports = { | ||
get: url => axios.get(`http://${host}:${port}/api/${url}`), |
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.
"arrowParens": "always",
server/models/index.js
Outdated
|
||
fs.readdirSync(__dirname).forEach((file) => { | ||
if (file === 'index.js' || file === 'base.js') { | ||
return; | ||
} | ||
|
||
const model = sequelize.import(path.join('../', __dirname, file)); | ||
const model = sequelize.import(path.join(isTest ? '' : '../', __dirname, file)); |
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 prefer to make a variable sequelizePath
right after L14. It help to group up the testing related logic in one place.
@rickmak updated, the travis fix is due to their image using port 5432 therefore cannot expose the same port |
I think this PR is mergeable. The command less stateful will be better, to achieve this:
|
Connects likecoin#23