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

More, relatively easy TS conversion #104

Merged
merged 1 commit into from
Aug 3, 2023
Merged

More, relatively easy TS conversion #104

merged 1 commit into from
Aug 3, 2023

Conversation

oyamauchi
Copy link
Member

The only substantive changes are:

  • In incentive-calculation.test.ts, where the calls to _.countBy
    were missing an argument and thus not counting anything.

  • In v0.test.js, where qs is used to encode GET params, because
    it's much less picky about what types you give it.

The only file left now is src/routes/v0.js, which won't be trivial,
so I'm doing it separately.

The only substantive changes are:

- In `incentive-calculation.test.ts`, where the calls to `_.countBy`
  were missing an argument and thus not counting anything.

- In `v0.test.js`, where `qs` is used to encode GET params, because
  it's much less picky about what types you give it.

The only file left now is `src/routes/v0.js`, which won't be trivial,
so I'm doing it separately.
@@ -38,15 +42,15 @@ test('response is valid and correct', async t => {

const calculatorResponse = JSON.parse(res.payload);

const ajv = new Ajv({
const ajv = new Ajv.default({
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a workaround for ajv-validator/ajv#2047 ; it's commented on in another test file.

@@ -171,12 +179,18 @@ test('correctly evaluates scenerio "Married filing jointly w/ 2 kids and $250k H
t.equal(data.tax_credit_incentives.length, 10);

// count the incentives by key used to de-dupe in UI:
const rebateCounts = _.countBy(i => i.item + i.item_type);
Copy link
Member

Choose a reason for hiding this comment

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

Yikes, thank you.

@RandomEtc
Copy link
Member

Verified very superficially that the test run appears to be running these tests. https://github.com/rewiringamerica/api.rewiringamerica.org/actions/runs/5744571228/job/15571117707?pr=104

@oyamauchi oyamauchi merged commit 18f6cc4 into main Aug 3, 2023
1 check passed
@oyamauchi oyamauchi deleted the owen/more-ts branch August 3, 2023 14:16
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.

2 participants