Closed florianbepunkt closed 5 years ago
Regarding tests… currently there are no params test, which makes sense since they would be adapter specific. But to demonstrate the basic use case:
it('Get: Retreives file from specified bucket', async () => {
const params = {
s3: {
Bucket: 'my-non-default-bucket'
}
};
const service = app.service('/file');
const blob = {
id: 'hello-world-different-bucket.txt',
uri: getBase64DataURI(
Buffer.from(new String('this is a test')),
'text/plain'
)
};
await service.create(blob, params);
await expect(service.get('hello-world-different-bucket.txt', params)).to.be
.fulfilled;
});
Not sure why tests are failing… seems to be an issue with the test config not the pr.
This makes sense, thank you! Tests are failing because external PRs don't have access to the S3 test credentials, it should be passing once merged.
If you would like to add the test you were mentioning, you should be able to run the tests locally (with a normal npm test
) by setting the AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
and S3_BUCKET
environment variables.
@daffl Shall I add a the test to this repo?
Summary
(If you have not already please refer to the contributing guideline as described here)
If so, please mention them to keep the conversations linked together.
Other Information
If there's anything else that's important and relevant to your pull request, mention that information here. This could include benchmarks, or other information.
Your PR will be reviewed by a core team member and they will work with you to get your changes merged in a timely manner. If merged your PR will automatically be added to the changelog in the next release.
If your changes involve documentation updates please mention that and link the appropriate PR in feathers-docs.
Thanks for contributing to Feathers! :heart: