Skip to content

Instantly share code, notes, and snippets.

Testing An Angular CLI Project in a Headless Environment

I recently started a new project and we used [Angular CLI][4] to get started. Angular CLI, as in the name, is a command line utility for creating and managing Angular 2 projects. Using Angular CLI to create a project is very easy and it gives you a great starting point for new Angular 2 projects. The only draw back I found was that in my mind it wasn't CI ready.

Angular CLI out of the box gives you a few unit tests and an end to end (e2e) test. This is great because you can generate a project and set up your build server to build the artefacts. This is where I ran into problems.

Having everything generated for you is great until something you want to do does not work; and this is where I was. I wanted to build and test my angular application on a headless build agent. The generated code from Angular CLI runs tests using Google Chrome by default. Which is fine, but running Google Chrome on a bui

@ackuser
ackuser / class_decorator.ts
Created September 27, 2017 11:00 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@ackuser
ackuser / neo4j_cypher_cheatsheet.md
Created November 20, 2017 13:58 — forked from DaniSancas/neo4j_cypher_cheatsheet.md
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
@ackuser
ackuser / get_gmail.py
Created November 20, 2017 14:44 — forked from tyndyll/get_gmail.py
Extract Mail from GMail and Import into Neo4J
#!/usr/local/env python
import argparse
import email
import extract
import getpass
import imaplib
import os
import sys
import uuid
export class Coordinates {
latitude: string | number;
longitude: string | number;
accuracy?: number;
constructor(that?: Coordinates) {
if (that) {
this.latitude = +that.latitude;
this.longitude = +that.longitude;
this.accuracy = +that.accuracy;
@ackuser
ackuser / angular.md
Created November 30, 2017 14:13 — forked from sinedied/angular.md
The Missing Introduction to Angular 2 and Modern Design Patterns

Introduction to Angular

Angular (aka Angular 2) is a new framework completely rewritten from the ground up, replacing the famous AngularJS framework (aka Angular 1.x).

More that just a framework, Angular should now be considered as a whole platform which comes with a complete set of tools, like its own CLI, debug utilities or performance tools.

Getting started

@ackuser
ackuser / install-pulse.sh
Created January 11, 2018 14:41 — forked from tafarij/install-pulse.sh
Install Pulse Secure on Ubuntu 16.04
# https://vt4help.service-now.com/kb_view_customer.do?sysparm_article=KB0010740#linux
wget https://secure.nis.vt.edu/resources/downloads/pulse-8.2R5.i386.deb
sudo dpkg –i pulse-8.2R5.i386.deb
/usr/local/pulse/PulseClient.sh install_dependency_packages
@ackuser
ackuser / cygwin_ssh_client_keep_alive.txt
Created January 15, 2018 10:49 — forked from hinst/cygwin_ssh_client_keep_alive.txt
Cygwin SSH Client keep alive // how to enable
If you use Cygwin and SSH and you are frustrated because you lose server connection after some time, then this could help you:
create the file cygwin/etc/ssh_config
place the following text:
KeepAlive yes
ServerAliveInterval 60
restart cygwin shell
sqoop list-databases \
--connect jdbc:mysql://ms.itversity.com:3306 \
--username retail_user \
--password itversity
sqoop list-tables \
--connect jdbc:mysql://ms.itversity.com:3306/retail_db \
--username retail_user \
--password itversity
@ackuser
ackuser / hover-class.directive.ts
Created April 23, 2018 12:12 — forked from TigorC/hover-class.directive.ts
Angular 2 hover class directive
import { Directive, Input, HostListener, Renderer, ElementRef } from '@angular/core';
@Directive({ selector: '[hoverClass]' })
export class HoverClassDirective {
@Input()
hoverClass: string;
constructor(
public elementRef: ElementRef,