Skip to content

Instantly share code, notes, and snippets.

View unlocomqx's full-sized avatar
🏠
Working from home

Tuni-Soft unlocomqx

🏠
Working from home
  • Module Dev - Tuni-Soft
  • [object Object]
View GitHub Profile
@unlocomqx
unlocomqx / cypress_test_404_spec.js
Created April 27, 2024 04:03 — forked from paulmwatson/cypress_test_404_spec.js
Testing a 404 page with Cypress
cy.visit('/404')
//=> Test fails
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes but does not test the HTTP code was 404
cy.request({url: '/404', failOnStatusCode: false}).its('status').should('equal', 404)
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes, tests that the HTTP code was 404, and tests page was visited
@unlocomqx
unlocomqx / App.svelte
Created September 28, 2023 06:01 — forked from jrmoynihan/App.svelte
A helper function for setting Svelte 5 $state() runes on objects
<script lang="ts">
import { gettable, settable, runed } from './runes.js'
const createFruit = (obj) => {
// An optional object of default values if the provided prop is nullish
const defaults = {
color: 'purple',
consumed: true,
count: 0
}