Skip to content

Add fixtures for API responses #211

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

Merged
merged 3 commits into from
Mar 19, 2021
Merged

Add fixtures for API responses #211

merged 3 commits into from
Mar 19, 2021

Conversation

thomashoneyman
Copy link
Member

The PureScript 0.14 release helped drive the point home, for me, that core libraries and infrastructure ought to use core libraries (or contrib, or node, etc.) wherever possible.

As part of the updates originally outlined in #199 I thought we could switch to use argonaut rather than foreign-generic for the API in Try PureScript. We already depend on argonaut and are receiving its Json type via Affjax, so it feels like a more natural fit than foreign-generic in addition to being a contrib library.

This PR takes a first step by adding API response fixtures and tests for the existing foreign-generic implementation. This helps ensure that switching to a new library will still decode correctly without having to test manually.

@@ -6,7 +6,9 @@
},
"scripts": {
"clean": "rimraf output",
"build": "spago bundle-app --path $npm_package_config_configpath --purs-args '--censor-lib --strict' --to public/js/index.js"
"test": "spago test --path $npm_package_config_configpath",
"build": "spago build --path $npm_package_config_configpath",
Copy link
Member Author

Choose a reason for hiding this comment

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

Could we switch this environment variable to something a little shorter? Perhaps TRY_CONFIG?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The reason we have the npm_package_config_ prefix is so that it can pick up the values from the config key in package.json by default if they haven't been explicitly overridden (e.g. like we do in CI:

npm config set trypurescript-client:configpath "config/prod/*.purs"
). We have to include the npm_package_config_ prefix for this to work. If there's another way to make npm run build Just Work in development and for the production config to be used in CI I'm happy to consider that.

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