Skip to content

Instantly share code, notes, and snippets.

View devinschumacher's full-sized avatar
🦩
stayin' funky

Devin Schumacher devinschumacher

🦩
stayin' funky
View GitHub Profile
@devinschumacher
devinschumacher / 1.md
Created November 15, 2024 17:39
Nuxt Data Fetching - `server/api` + `composables`

Data fetching in Nuxt server/api/

Checklist:

  1. types
  2. endpoints
  3. composables
  4. tests

Types

@devinschumacher
devinschumacher / 1.md
Created November 15, 2024 08:56
software testing notes

HTML Elements and Whether to Test Them

1. Interactive Elements

  • Button (<button>) - Yes
    • Test clicks and check if they trigger the correct actions or events.
  • Link (<a>) - Yes
    • Test that it navigates to the expected URL or triggers an event (e.g., in SPAs).
  • Input (<input>) - Yes
    • Test value updates, focus, placeholder text, and any expected validation.
  • Select (``) - Yes
@devinschumacher
devinschumacher / post.md
Created November 14, 2024 19:14
How to setup a mock API server in postman

How to setup a mock API server in postman

  1. Get the swagger/OAS specification .yaml file
  2. Navigate to collections > import

image

  1. Choose the OpenAPI setting & make sure View Import Settings is set to 'schema'

image

@devinschumacher
devinschumacher / post.md
Created November 12, 2024 02:54
How to enable vitest auto imports (globals)
title tags
How to enable vitest auto imports (globals)
vitest
globals
testing
tsconfig
nuxt
vue

How to enable vitest auto imports (globals) in Vue/Nuxt

  1. Add globals to the vitest config (or vite config) in the defineConfig object
@devinschumacher
devinschumacher / post.md
Last active November 9, 2024 02:15
Why Test?
title tags
API Response Shape Break (Caching layer edition example)
server/api
db
caching
unit tests
integration tests

API Response Shape Break (Caching layer edition example)

Scenario: Caching Layer Addition

  • Potential breaks: Type safety, data structure consistency
@devinschumacher
devinschumacher / 0-test-tools.md
Last active November 14, 2024 12:41
Architecture, Setup & Config for: Nuxt3 + vitest + @nuxt/test-utils + typescript

image


image


image

@devinschumacher
devinschumacher / post.md
Created November 7, 2024 19:15
mountSuspended in vitest + @nuxt/test-utils
title tags
mountSuspended in Nuxt w/ vitest + @nuxt/test-utils
testing
nuxt
vitest
nuxt test utils
mountSuspended

What is mountSuspended in a Nuxt project w/ vitest + @nuxt/test-utils

Mounting in a suspended state means the component is mounted with support for async behavior.

mountSuspended waits for all async operations to complete before returning the fully rendered component.

@devinschumacher
devinschumacher / post.md
Last active November 5, 2024 13:24
Github Todos: Personal Project Management using Github
title tags
How to Stay Organized with Your Todos Using Github for Personal Project Management
github
project mangement
productivity
organization
todos

How to Stay Organized with Your Todos Using Github for Personal Project Management

Using Github for project management is awesome, especially if you're a developer (or a version control enthusiast of any kind) because you spend so much of your time there anyways - so why not make it the source of truth for everything?

@devinschumacher
devinschumacher / post.md
Last active October 29, 2024 16:35
How To Combine/Merge Multiple CSV Or Excel Files (For Mac & PC)
title
How To Combine/Merge Multiple CSV Or Excel Files (For Mac & PC)

How To Combine Multiple CSV Or Excel Files (For Mac & PC)

Table of Contents:

@devinschumacher
devinschumacher / post.md
Created October 29, 2024 01:29
How to make Vitest include all your files in the test coverage reports
title tags
How to make Vitest include all your files in the test coverage reports
vue
nuxt
vitest
software testing
test coverage
cicd
sre

How to make Vitest include all your files in the test coverage reports

By default, Vitest only includes files that are imported during test runs in the coverage report. If a file isn't imported in any test, it won't be included in the coverage report.