Merge remote-tracking branch 'origin/master'
commit
88b9937387
@ -0,0 +1,40 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Dependencies') {
|
||||
steps {
|
||||
echo 'Installing Dependencies...'
|
||||
nodejs(nodeJSInstallationName: 'Node 12.x') {
|
||||
sh 'yarn install'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Stylecheck') {
|
||||
steps {
|
||||
echo 'Checking Style...'
|
||||
nodejs(nodeJSInstallationName: 'Node 12.x') {
|
||||
sh 'tslint "src/**/*.ts"'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
echo 'Building...'
|
||||
nodejs(nodeJSInstallationName: 'Node 12.x') {
|
||||
sh 'gulp'
|
||||
}
|
||||
sh '/bin/tar -zcvf greenvironment-server.tar.gz dist'
|
||||
archiveArtifacts artifacts: 'greenvironment-server.tar.gz', fingerprint: true
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
steps {
|
||||
echo 'Testing...'
|
||||
nodejs(nodeJSInstallationName: 'Node 12.x') {
|
||||
sh 'yarn test'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,67 @@
|
||||
/**
|
||||
* An interface for the configuration file
|
||||
*/
|
||||
interface IConfig {
|
||||
/**
|
||||
* Database connection info
|
||||
*/
|
||||
database: {
|
||||
/**
|
||||
* A connection uri for the database. <type>://<user>:<password>@<ip/domain>/<database>
|
||||
*/
|
||||
connectionUri: string;
|
||||
};
|
||||
/**
|
||||
* Configuration for the http server
|
||||
*/
|
||||
server?: {
|
||||
/**
|
||||
* The port to listen on
|
||||
*/
|
||||
port?: number;
|
||||
/**
|
||||
* If cross origin requests should be enabled
|
||||
*/
|
||||
cors?: false;
|
||||
};
|
||||
/**
|
||||
* The session configuration
|
||||
*/
|
||||
session: {
|
||||
/**
|
||||
* A secure secret to be used for sessions
|
||||
*/
|
||||
secret: string;
|
||||
/**
|
||||
* The maximum cookie age before the session gets deleted
|
||||
*/
|
||||
cookieMaxAge: number;
|
||||
};
|
||||
/**
|
||||
* Configuration for markdown parsing
|
||||
*/
|
||||
markdown?: {
|
||||
/**
|
||||
* The plugins to use for parsing
|
||||
*/
|
||||
plugins: string[];
|
||||
};
|
||||
/**
|
||||
* Logging configuration
|
||||
*/
|
||||
logging?: {
|
||||
/**
|
||||
* The loglevel that is used for the console and logfiles
|
||||
*/
|
||||
level?: ("silly" | "debug" | "verbose" | "info" | "warn" | "error");
|
||||
};
|
||||
/**
|
||||
* The frontend configuration
|
||||
*/
|
||||
frontend?: {
|
||||
/**
|
||||
* Points to the index.html which is loaded as a fallback for angular to work
|
||||
*/
|
||||
angularIndex?: string;
|
||||
};
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
import {expect} from "chai";
|
||||
import {describe, it} from "mocha";
|
||||
import markdown from "../../lib/markdown";
|
||||
|
||||
describe("markdown", () => {
|
||||
describe("renderInline", () => {
|
||||
it("renders markdown inline expressions", () => {
|
||||
const result = markdown.renderInline("**Hello**");
|
||||
expect(result).to.equal("<strong>Hello</strong>");
|
||||
});
|
||||
it("renders markdown emoji", () => {
|
||||
const result = markdown.renderInline(":smile:");
|
||||
expect(result).to.equal("😄");
|
||||
});
|
||||
});
|
||||
describe("render", () => {
|
||||
it("renders markdown block expressions", () => {
|
||||
const result = markdown.render("#header\n```\n```");
|
||||
expect(result).to.equal("<p>#header</p>\n<pre><code></code></pre>\n");
|
||||
});
|
||||
it("renders markdown emoji", () => {
|
||||
const result = markdown.render(":smile:");
|
||||
expect(result).to.equal("<p>😄</p>\n");
|
||||
});
|
||||
});
|
||||
});
|
@ -0,0 +1,20 @@
|
||||
import {expect} from "chai";
|
||||
import {describe, it} from "mocha";
|
||||
import {is} from "../../lib/regex";
|
||||
|
||||
describe("regex", () => {
|
||||
describe("email", () => {
|
||||
it("identifies right emails", () => {
|
||||
const result = is.email("trivernis@mail.com");
|
||||
expect(result).to.equal(true);
|
||||
});
|
||||
it("identifies non-email urls", () => {
|
||||
const result = is.email("notanemail.com");
|
||||
expect(result).to.equal(false);
|
||||
});
|
||||
it("identifies malformed emails", () => {
|
||||
const result = is.email("trivernis@mail.");
|
||||
expect(result).to.equal(false);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue