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

Cache helper test + eslint update #1025

Merged
merged 3 commits into from Mar 30, 2018
Merged

Cache helper test + eslint update #1025

merged 3 commits into from Mar 30, 2018

Conversation

aaronschachter
Copy link
Contributor

What's this PR do?

Adds a test for the cache helper in #1024, which is essentially a copy/paste job from Conversations.

Our linter wasn't happy with the use of rewire, complaining about a TypeError: Assignment to constant variable.. Updating our lint config to match Conversations made it happy, and required some cleanup in other files.

How should this be reviewed?

npm run all-tests

Any background context you want to provide?

Once #1024 is merged, I'll edit this PR to merge into master instead of cleanup/cache.

@codecov
Copy link

codecov bot commented Mar 29, 2018

Codecov Report

Merging #1025 into cleanup/cache will increase coverage by 0.19%.
The diff coverage is 100%.

Impacted file tree graph

@@                Coverage Diff                @@
##           cleanup/cache    #1025      +/-   ##
=================================================
+ Coverage          61.25%   61.45%   +0.19%     
=================================================
  Files                 66       66              
  Lines               1017     1017              
=================================================
+ Hits                 623      625       +2     
+ Misses               394      392       -2
Impacted Files Coverage Δ
app/exceptions/UnprocessibleEntityError.js 0% <ø> (ø) ⬆️
app/exceptions/ClosedCampaignError.js 33.33% <ø> (ø) ⬆️
lib/middleware/timeouts.js 100% <ø> (ø) ⬆️
lib/tools/uploader.js 0% <ø> (ø) ⬆️
lib/tools/profiler.js 0% <ø> (ø) ⬆️
lib/contentful.js 91.89% <100%> (+1.35%) ⬆️
lib/helpers/cache.js 100% <0%> (+11.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4fa18c0...e7358e1. Read the comment docs.

@aaronschachter aaronschachter changed the base branch from cleanup/cache to master March 30, 2018 15:57
@aaronschachter aaronschachter merged commit d0629b7 into master Mar 30, 2018
Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

Looking good. I'd say this is ready for rebase once #1024 goes out.


Was this helpful? Let us know!

result.should.deep.equal(campaign);
});

test('campaigns.get should return falsy when cache undefined', async (t) => {
Copy link

Choose a reason for hiding this comment

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

Thanks for the descriptive tests 👌

.then(entries => resolve(underscore.first(entries.items)))
.catch(error => reject(exports.contentfulError(error)));
.then(entries => resolve(underscore.first(entries.items)))
.catch(error => reject(exports.contentfulError(error)));
Copy link

Choose a reason for hiding this comment

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

Indentation looks better, and probably makes the linter happy as well 🙂

@aaronschachter aaronschachter deleted the eslint branch March 30, 2018 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants