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

Refactor and add tests #13

Merged
merged 4 commits into from
Jan 23, 2024
Merged

Refactor and add tests #13

merged 4 commits into from
Jan 23, 2024

Conversation

mikemaccana
Copy link
Contributor

@mikemaccana mikemaccana commented Jan 2, 2024

This PR moves logic out of the request handler into their own testable functions, adds a bunch of tests, and uses GitHub Actions to run the tests.

add: tests using jest
refactor: move checks out of request handler into own files
add: CI using github actions
add: some console.debug() with reason for each rejection
refactor: use getKeypairFromEnvironment()
refactor: use a character range to clean out IP address separators in a single step
add: README updates

Copy link

vercel bot commented Jan 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
solana-devnet-faucet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2024 6:07pm

@@ -45,7 +45,7 @@ export default function Home() {
});
const [showVerifyDialog, setShowVerifyDialog] = useState<boolean>(false);
const toaster = useToast();
const [network, setSelectedNetwork] = useState('devnet');
const [network, setSelectedNetwork] = useState("devnet");
Copy link
Contributor Author

@mikemaccana mikemaccana Jan 2, 2024

Choose a reason for hiding this comment

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

This is just linting, run automatically on save.

lib/validate.ts Show resolved Hide resolved
pages/api/request.ts Outdated Show resolved Hide resolved
pages/api/request.ts Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
This PR moves logic out of the request handler into their own testable functions, adds a bunch of tests, and uses GitHub Actions to run the tests.

add: tests using jest
refactor: move checks out of request handler into own files
add: CI using github actions
add: some console.debug() with reason for each rejection
refactor: use getKeypairFromEnvironment()
refactor: use a character range to clean out IP address separators in a single step
add: README updates

chore: formatting only

fix: ignore .env files

add: more README bits

refactor: revert to getting FAUCET_KEYPAIR on every request (it gives better error messages and allows up to fix environment live)

add: minor docs and .gitignore tweaks.

add: more README bits
@mikemaccana mikemaccana merged commit 3daa4f9 into main Jan 23, 2024
3 checks passed
mikemaccana added a commit that referenced this pull request Jan 24, 2024
…d-tests"

This reverts commit 3daa4f9, reversing
changes made to 44cc9c0.
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