Skip to content

Instantly share code, notes, and snippets.

View pablocattaneo's full-sized avatar

Pablo Cattaneo pablocattaneo

View GitHub Profile
https://github.com/xjamundx/eslint-plugin-promise
// Using stubs
import { shallowMount } from '@vue/test-utils'
import LmPagination from '@/components/LmPagination.vue'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
describe('LmPagination', () => {
const wrapper = shallowMount(LmPagination, {
propsData: {
allRegistries: 300,
1 - sudo vue add @vue/unit-jest
2 - Clear Jest cache. You can find the cache location by running `jest --showConfig`. Look for `cacheDirectory` key. Its value is the name of the folder you'll need to remove.
3 - Create test files into project_name/tests/unit/. file must have this structure name.spec.js for example /home/pablo/projects/lumbre/lumbre-vue-admin/tests/unit/LmPagination.spec.js
4 - In the terminal yarn test:unit
function User (name,age) {
this.name = name,
this.age = age
}
var user1 = new User('Pablo', 36)
var user2 = new User('Victoria', 34)
User.prototype.emailDomain = '@family.com'
.avoid-clicks {
pointer-events: none;
}
/* Example: https://davidwalsh.name/demo/pointer-events.php */
@pablocattaneo
pablocattaneo / how_to_compile_a_sass_file.zsh
Created January 25, 2019 13:49
How to compile a Sass file? #Sass Source: https://sass-lang.com/guide
sass --watch input.scss output.css
app.use('/images', express.static(path.join(__dirname, path_folder_storaging_images)))
// Example
const path = require('path')
app.use('/images', express.static(path.join(__dirname, 'images')))
.collection('collectionName').findOne({key:value})
// Example
const db = require('../db')
const ObjectId = require('mongodb').ObjectId
exports.getUser = ((req, res) => {
console.log('getUser')
filter = {
_id: new ObjectId(req.params.userId)
}
db.collectionName.find({ key:value })
// Example:
db.usersToSendEmail.find({_id: ObjectId("5c405972f3d33522c6242d31")})
const inventory = [
{name: 'apples', quantity: 2},
{name: 'bananas', quantity: 0},
{name: 'cherries', quantity: 5}
];
const result = inventory.find( fruit => fruit.name === 'cherries' );
console.log(result) // { name: 'cherries', quantity: 5 }