Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Alberto Suarez holylander

🏠
Working from home
View GitHub Profile
@holylander
holylander / allowStringsInJest.js
Last active Nov 20, 2020
spfx localized strings Jest testing workaround
View allowStringsInJest.js
//just save a copy of this script under ./scripts/
const fs = require("fs");
/** returns an arrays with as many indexes as "target" appeards on input */
const findIndexes = (input, target) => {
const indexes = [];
var currentIndex = 0;
while (currentIndex < input.length) {
currentIndex = input.indexOf(target, currentIndex)