This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create a module for vue component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { hook, Instrumenter } from 'babel-istanbul'; | |
import { clone } from 'lodash'; | |
let instrumenter = null; | |
const baselineCoverage = {}; | |
export function getCoverageObject() { | |
global.coverage = global.coverage || {}; | |
return global.coverage; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app-style.js | |
// adding <style></style> directly inside template will result in error or empty element which | |
// this component is trying to address | |
// this will allow you to dynamically insert css inside Vue template without the use of vue loader | |
// or if you do not want to use .vue extension at all | |
// however it doesnt really apply scope css (for now). | |
export default { | |
name: 'app-style', | |
data: function(){ | |
return { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An `Object.observe()` "polyfill" using ES6 Proxies. | |
// | |
// Current `Object.observe()` polyfills [1] rely on polling | |
// to watch for property changes. Proxies can do one better by | |
// observing property changes to an object without the need for | |
// polling. | |
// | |
// Known limitations of this technique: | |
// 1. the call signature of `Object.observe()` will return the proxy | |
// object. The original object needs to be overwritten with this return value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm i jsdom-wc@11.0.0-alpha-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using rollup-plugin-vue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on code from https://stackoverflow.com/questions/38779924/compiling-webpack-in-memory-but-resolving-to-node-modules-on-disk | |
import * as webpack from 'webpack' | |
import * as MemoryFileSystem from 'memory-fs' | |
import * as path from 'path' | |
import * as fs from 'fs' | |
import * as promisify from 'util.promisify' | |
const memFs = new MemoryFileSystem() | |
const statOrig = memFs.stat.bind(memFs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Directive, TemplateRef, Input, ChangeDetectorRef, ViewContainerRef, | |
IterableDiffers, OnChanges, SimpleChanges, SimpleChange | |
} from '@angular/core'; | |
import { NgFor } from "@angular/common"; | |
import { NgForRow } from "@angular/common/src/directives/ng_for"; | |
@Directive({ | |
selector: '[ngFor][ngForIn]' | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, lib, bash, callPackage, writeText, makeWrapper, writeScript, dotnet-sdk, | |
patchelf, libunwind, coreclr, libuuid, curl, zlib, icu }: | |
let | |
config = "Staging"; | |
project = "RazorCx.Api"; | |
target = "linux-x64"; | |
rpath = stdenv.lib.makeLibraryPath [ libunwind coreclr libuuid stdenv.cc.cc curl zlib icu ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ES6/ES2015 classes */ | |
class A { | |
constructor() { | |
this.a = 10 | |
} | |
print() { | |
console.log(this.a, this.b) | |
} | |
} |
OlderNewer