- very similar to Website tests
import { isLegitAdmin } from 'utils/UserUtils'
describe('UserUtils', () => {
it('`isLegitAdmin` returns false if no `user` is provided', () => {
expect(isLegitAdmin()).toBe(false)
})
function getAadToken(user, password, identifier) { | |
return puppeteer.launch({ headless: true }).then(async browser => { | |
try { | |
const page = await browser.newPage(); | |
await page.goto("SITEURL"); | |
await page.click( | |
"LOGINBUTTON" | |
); |
"use strict"; | |
// Load plugins | |
const autoprefixer = require("autoprefixer"); | |
const browsersync = require("browser-sync").create(); | |
const cp = require("child_process"); | |
const cssnano = require("cssnano"); | |
const del = require("del"); | |
const eslint = require("gulp-eslint"); | |
const gulp = require("gulp"); |
#!/usr/bin/bash | |
GIT_CMD="$(which git)" | |
GIT_BRANCH="$GIT_CMD branch" | |
GIT_PUSH_ORIGIN="$GIT_CMD push origin" | |
GIT_FETCH_ORIGIN="$GIT_CMD fetch origin" | |
GIT_REMOTE_PRUNE="$GIT_CMD remote prune origin" | |
GIT_CHECK_BRANCH="$GIT_CMD show-ref refs/heads" # append /branch_name | |
# Check if the user has provided input |
const atimport = require("postcss-import"); | |
const { dest, src, task } = require("gulp"); | |
const postcss = require("gulp-postcss"); | |
const purgecss = require("@fullhuman/postcss-purgecss"); | |
const tailwindcss = require("tailwindcss"); | |
const TAILWIND_CONFIG = "./tailwind.config.js"; | |
const SOURCE_STYLESHEET = "./src/style.css"; | |
const DESTINATION_STYLESHEET = "./build/style.css"; |
const axios = require('axios') | |
/* ... */ | |
const params = new URLSearchParams() | |
params.append('name', 'Akexorcist') | |
params.append('age', '28') | |
params.append('position', 'Android Developer') | |
params.append('description', 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/') | |
params.append('awesome', true) |
// This can probably be simplified somehow. Not sure why I need to add it in the component to init the service. | |
import { Component, OnInit } from '@angular/core'; | |
import {TitleService} from "./@core/utils/title.service"; | |
@Component({...}) | |
export class AppComponent implements OnInit { | |
constructor(private titleService: TitleService) {...} |
A simple Webpack + Gulpfile configuration wihtout any need for React.js that assumes you have the following project structure:
node_modules/
bower_components/
scripts/
Entry script is in scripts/entry.js
You should run gulp && gulp build-dev
and you are good to go.
#! /usr/bin/env node | |
/* eslint-env node */ | |
// Boot it up with: | |
// $ node customDevServer.js | |
// ...or: | |
// $ chmod +X customDevServer.js | |
// $ ./customDevServer.js | |
const webpack = require('webpack'); |
{ | |
"directory": "wwwroot/scripts/bower" | |
} |