Skip to content

Instantly share code, notes, and snippets.

View agm1984's full-sized avatar

Adam Mackintosh agm1984

View GitHub Profile
@agm1984
agm1984 / LoginTest.php
Last active July 10, 2020 03:29
Demonstration of `resetAuth` function
<?php
namespace Tests\Auth;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class LoginTest extends TestCase
{
@agm1984
agm1984 / .jest.config.js
Last active July 10, 2020 06:24
Demonstration of `.jest.config.js` for `vue-jest` and `jest`
module.exports = {
testRegex: 'resources/js/.*.spec.js$',
moduleFileExtensions: [
'js',
'json',
'vue',
],
transform: {
'^.+\\.vue$': 'vue-jest',
'^.+\\.js$': 'babel-jest',
@agm1984
agm1984 / .babelrc
Created July 10, 2020 06:40
`.babelrc` settings for Laravel + Vue + Jest
{
"env": {
"test": {
"presets": [["@babel/preset-env", { "targets": { "node": "current" } }]]
}
}
}
@agm1984
agm1984 / SomeTest.php
Last active July 11, 2020 07:34
Quick demonstration of using `DatabaseTransactions` trait in Laravel unit tests
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class SomeTest extends TestCase
{
use DatabaseTransactions;