Format all source files
This commit is contained in:
parent
d950d1d265
commit
6ab7b8d962
10
.eslintrc.js
10
.eslintrc.js
|
|
@ -4,13 +4,15 @@ module.exports = {
|
||||||
commonjs: true,
|
commonjs: true,
|
||||||
es6: true
|
es6: true
|
||||||
},
|
},
|
||||||
extends: "standard",
|
extends: ['standard', 'prettier'],
|
||||||
globals: {
|
globals: {
|
||||||
Atomics: "readonly",
|
Atomics: 'readonly',
|
||||||
SharedArrayBuffer: "readonly"
|
SharedArrayBuffer: 'readonly'
|
||||||
},
|
},
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
ecmaVersion: 2018
|
ecmaVersion: 2018
|
||||||
},
|
},
|
||||||
rules: {}
|
rules: {
|
||||||
|
semi: 0
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,5 @@
|
||||||
/node_modules/
|
/node_modules/
|
||||||
/tmp/
|
/tmp/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/dist
|
/dist
|
||||||
|
IDEAS.md
|
||||||
|
|
|
||||||
69
gulpfile.js
69
gulpfile.js
|
|
@ -1,13 +1,18 @@
|
||||||
'use strict';
|
const gulp = require('gulp');
|
||||||
|
const plumber = require('gulp-plumber');
|
||||||
|
|
||||||
const gulp = require('gulp'),
|
const {
|
||||||
fs = require('fs'),
|
SOURCE,
|
||||||
plumber = require('gulp-plumber');
|
DIST,
|
||||||
|
WORKING_DIR,
|
||||||
|
CONFIGURATION_FILE
|
||||||
|
} = require('./constants');
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
source: 'templates',
|
source: SOURCE,
|
||||||
dist: 'dist',
|
dist: DIST,
|
||||||
workingDir: 'tmp',
|
workingDir: WORKING_DIR,
|
||||||
|
configurationFile: CONFIGURATION_FILE,
|
||||||
src: function plumbedSrc() {
|
src: function plumbedSrc() {
|
||||||
return gulp.src.apply(gulp, arguments).pipe(plumber());
|
return gulp.src.apply(gulp, arguments).pipe(plumber());
|
||||||
}
|
}
|
||||||
|
|
@ -16,35 +21,35 @@ const options = {
|
||||||
/**
|
/**
|
||||||
* Load tasks from the '/tasks' directory.
|
* Load tasks from the '/tasks' directory.
|
||||||
*/
|
*/
|
||||||
const build = require('./tasks/build')(options);
|
require('./tasks/build')(options);
|
||||||
const checkDeps = require('./tasks/check-deps')(options);
|
require('./tasks/dupe')(options);
|
||||||
const dupe = require('./tasks/dupe')(options);
|
require('./tasks/less')(options);
|
||||||
const less = require('./tasks/less')(options);
|
require('./tasks/lint')(options);
|
||||||
const lint = require('./tasks/lint')(options);
|
require('./tasks/postcss')(options);
|
||||||
const postcss = require('./tasks/postcss')(options);
|
require('./tasks/sass')(options);
|
||||||
const sass = require('./tasks/sass')(options);
|
require('./tasks/check-deps')(options);
|
||||||
|
|
||||||
/* Runs the entire pipeline once. */
|
/* Runs the entire pipeline once. */
|
||||||
gulp.task('run-pipeline', gulp.series('dupe', 'less', 'sass', 'postcss', 'lint', 'build'));
|
gulp.task(
|
||||||
|
'run-pipeline',
|
||||||
|
gulp.series('dupe', 'less', 'sass', 'postcss', 'lint', 'build')
|
||||||
|
);
|
||||||
|
|
||||||
/* By default templates will be built into '/dist'. */
|
/* By default templates will be built into '/dist'. */
|
||||||
gulp.task(
|
gulp.task(
|
||||||
'default',
|
'default',
|
||||||
gulp.series(
|
gulp.series('run-pipeline', () => {
|
||||||
'run-pipeline',
|
/* gulp will watch for changes in '/templates'. */
|
||||||
() => {
|
gulp.watch(
|
||||||
/* gulp will watch for changes in '/templates'. */
|
[
|
||||||
gulp.watch(
|
options.source + '/**/*.html',
|
||||||
[
|
options.source + '/**/*.css',
|
||||||
options.source + '/**/*.html',
|
options.source + '/**/*.scss',
|
||||||
options.source + '/**/*.css',
|
options.source + '/**/*.less',
|
||||||
options.source + '/**/*.scss',
|
options.source + '/**/conf.json'
|
||||||
options.source + '/**/*.less',
|
],
|
||||||
options.source + '/**/conf.json'
|
{ delay: 500 },
|
||||||
],
|
gulp.series('run-pipeline')
|
||||||
{ delay: 500 },
|
);
|
||||||
gulp.series('run-pipeline')
|
})
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -3082,6 +3082,23 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"eslint-config-prettier": {
|
||||||
|
"version": "6.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.2.0.tgz",
|
||||||
|
"integrity": "sha512-VLsgK/D+S/FEsda7Um1+N8FThec6LqE3vhcMyp8mlmto97y3fGf3DX7byJexGuOb1QY0Z/zz222U5t+xSfcZDQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"get-stdin": "^6.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"get-stdin": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"eslint-config-standard": {
|
"eslint-config-standard": {
|
||||||
"version": "14.1.0",
|
"version": "14.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.0.tgz",
|
||||||
|
|
|
||||||
187
tasks/build.js
187
tasks/build.js
|
|
@ -1,69 +1,67 @@
|
||||||
'use strict';
|
const gulp = require('gulp');
|
||||||
|
const inlineCss = require('gulp-inline-css');
|
||||||
const gulp = require('gulp'),
|
const minifyHTML = require('gulp-minify-html');
|
||||||
inlineCss = require('gulp-inline-css'),
|
const minifyInline = require('gulp-minify-inline');
|
||||||
minifyHTML = require('gulp-minify-html'),
|
const preprocess = require('gulp-preprocess');
|
||||||
minifyInline = require('gulp-minify-inline'),
|
const rename = require('gulp-rename');
|
||||||
preprocess = require('gulp-preprocess'),
|
const klaw = require('klaw');
|
||||||
rename = require('gulp-rename'),
|
const fs = require('fs');
|
||||||
klaw = require('klaw'),
|
const del = require('del');
|
||||||
fs = require('fs'),
|
const inlineimg = require('gulp-inline-images-no-http');
|
||||||
del = require('del'),
|
const path = require('path');
|
||||||
jsonlint = require('jsonlint'),
|
|
||||||
inlineimg = require('gulp-inline-images-no-http'),
|
|
||||||
path = require('path');
|
|
||||||
|
|
||||||
function buildTask(options) {
|
function buildTask(options) {
|
||||||
// Requires: 'dupe', 'less', 'sass', 'postcss', 'lint'.
|
const { configurationFile } = options;
|
||||||
gulp.task(
|
|
||||||
'build',
|
|
||||||
function build(done) {
|
|
||||||
/**
|
|
||||||
* Makes templates for a given directory & its configurations.
|
|
||||||
*
|
|
||||||
* @function makeTemplates
|
|
||||||
* @param {String} dir Directory to make templates from.
|
|
||||||
* @param {Array} confItems A list of configurations objects (usually persons) to make templates from.
|
|
||||||
*/
|
|
||||||
function makeTemplates(dir, confItems) {
|
|
||||||
confItems.forEach(function handleConf(conf) {
|
|
||||||
var cwd = options.workingDir + '/' + dir;
|
|
||||||
var stylesheets = [];
|
|
||||||
|
|
||||||
/**
|
// Requires: 'dupe', 'less', 'sass', 'postcss', 'lint'.
|
||||||
* Find stylesheets relative to the CWD & generate <link> tags.
|
gulp.task('build', function build(done) {
|
||||||
* This way we can automagically inject them into <head>.
|
/**
|
||||||
*/
|
* Makes templates for a given directory & its configurations.
|
||||||
|
*
|
||||||
|
* @function makeTemplates
|
||||||
|
* @param {String} dir Directory to make templates from.
|
||||||
|
* @param {Array} confItems A list of configurations objects (usually persons) to make templates from.
|
||||||
|
*/
|
||||||
|
function makeTemplates(dir, confItems) {
|
||||||
|
return confItems.map(conf => {
|
||||||
|
const cwd = options.workingDir + '/' + dir;
|
||||||
|
const files = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find stylesheets relative to the CWD & generate <link> tags.
|
||||||
|
* This way we can automagically inject them into <head>.
|
||||||
|
*/
|
||||||
|
return new Promise(resolve => {
|
||||||
klaw(cwd)
|
klaw(cwd)
|
||||||
.on('readable', function walkTemplateDir() {
|
.on('readable', function walkTemplateDir() {
|
||||||
var stylesheet;
|
let file;
|
||||||
|
|
||||||
while ((stylesheet = this.read())) {
|
while ((file = this.read())) {
|
||||||
var relativePath = __dirname.substring(0, __dirname.lastIndexOf('/')) + '/tmp/' + dir;
|
const relativePath =
|
||||||
stylesheets.push(stylesheet.path.replace(relativePath, ''));
|
__dirname.substring(0, __dirname.lastIndexOf('/')) +
|
||||||
|
'/tmp/' +
|
||||||
|
dir;
|
||||||
|
files.push(file.path.replace(relativePath, ''));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('end', function finishedTemplateDirWalk() {
|
.on('end', function finishedTemplateDirWalk() {
|
||||||
const context = Object.assign(
|
/**
|
||||||
conf,
|
* Creates a context of stylesheets to inject them into HTML files later.
|
||||||
{
|
* Generates a list of <link> tags with the found stylesheets.
|
||||||
stylesheets: stylesheets
|
*/
|
||||||
.filter(function filterFiles (file) {
|
const context = Object.assign(conf, {
|
||||||
/* Read only CSS files. */
|
stylesheets: files
|
||||||
return file.match(/.*\.css/) ? true : false;
|
.filter(file => !!file.match(/.*\.css/)) // Read only CSS files.
|
||||||
})
|
.reduce((acc, cur) => {
|
||||||
.reduce(function (prev, current, index, acc) {
|
const cssPath = path.win32.basename(cur);
|
||||||
var cssPath = path.win32.basename(current);
|
return (acc +=
|
||||||
return (prev += '<link rel="stylesheet" href="' + cssPath + '">');
|
'<link rel="stylesheet" href="' + cssPath + '">');
|
||||||
}, '')
|
}, '')
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
options
|
options
|
||||||
.src([cwd + '/**/*.html', '!' + cwd + '/**/*.inc.html'])
|
.src([cwd + '/**/*.html', '!' + cwd + '/**/*.inc.html'])
|
||||||
.pipe(
|
.pipe(preprocess({ context }))
|
||||||
preprocess({ context })
|
|
||||||
)
|
|
||||||
.pipe(inlineimg())
|
.pipe(inlineimg())
|
||||||
.pipe(
|
.pipe(
|
||||||
inlineCss({
|
inlineCss({
|
||||||
|
|
@ -83,43 +81,58 @@ function buildTask(options) {
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.pipe(gulp.dest(options.dist));
|
.pipe(gulp.dest(options.dist));
|
||||||
|
|
||||||
|
resolve();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
|
|
||||||
/* Clean up & then read 'src' to generate templates (build entry point). */
|
|
||||||
return del(options.dist)
|
|
||||||
.then(function buildStart() {
|
|
||||||
/**
|
|
||||||
* Loop through dirs and load their conf files.
|
|
||||||
* Promisify all 'makeTemplate' calls and when resolved, let gulp know we're done.
|
|
||||||
*/
|
|
||||||
var files = [];
|
|
||||||
var promises = [];
|
|
||||||
|
|
||||||
fs.readdirSync('./' + options.workingDir).forEach(function readConfigurations(dir) {
|
|
||||||
/** NB: For 'watch' to properly work, the cache needs to be deleted before each require. */
|
|
||||||
var confPath = '../tmp/' + dir + '/conf.json';
|
|
||||||
var current = null;
|
|
||||||
var confItems;
|
|
||||||
|
|
||||||
delete require.cache[require.resolve(confPath)];
|
|
||||||
current = require(confPath);
|
|
||||||
if (current && current.length) {
|
|
||||||
confItems = [...current];
|
|
||||||
} else {
|
|
||||||
confItems = [current];
|
|
||||||
}
|
|
||||||
|
|
||||||
promises.push(makeTemplates(dir, confItems));
|
|
||||||
});
|
|
||||||
|
|
||||||
Promise.all(promises);
|
|
||||||
})
|
|
||||||
.then(() => done())
|
|
||||||
.catch((err) => console.log(err));
|
|
||||||
}
|
}
|
||||||
);
|
|
||||||
|
/*
|
||||||
|
* Clean up & then read from workingDir to generate templates.
|
||||||
|
* For each found config, a template group will be generated through `makeTemplates`.
|
||||||
|
*/
|
||||||
|
return del(options.dist)
|
||||||
|
.then(function buildStart() {
|
||||||
|
/**
|
||||||
|
* Loop through dirs and load their conf files.
|
||||||
|
* Promisify all 'makeTemplate' calls and when resolved, let gulp know we're done.
|
||||||
|
*/
|
||||||
|
const promises = [];
|
||||||
|
|
||||||
|
fs.readdirSync(options.workingDir).forEach(function readConfigurations(
|
||||||
|
dir
|
||||||
|
) {
|
||||||
|
const confPath = `../tmp/${dir}/${configurationFile}`;
|
||||||
|
|
||||||
|
/** Exit with warn if no configuration file found. */
|
||||||
|
if (!fs.existsSync(path.resolve(options.workingDir, confPath))) {
|
||||||
|
return console.warn(
|
||||||
|
`Missing configuration in "${dir}". Did you remember to create "${dir}/${configurationFile}"?`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let current = null;
|
||||||
|
let confItems;
|
||||||
|
|
||||||
|
delete require.cache[require.resolve(confPath)]; // NB: For 'watch' to properly work, the cache needs to be deleted before each require.
|
||||||
|
current = require(confPath);
|
||||||
|
|
||||||
|
// Handle single objects or arrays of configs.
|
||||||
|
if (current && current.length) {
|
||||||
|
confItems = [...current];
|
||||||
|
} else {
|
||||||
|
confItems = [current];
|
||||||
|
}
|
||||||
|
|
||||||
|
promises.push(makeTemplates(dir, confItems));
|
||||||
|
});
|
||||||
|
|
||||||
|
Promise.all(promises);
|
||||||
|
})
|
||||||
|
.then(() => done())
|
||||||
|
.catch(err => console.log(err));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = buildTask;
|
module.exports = buildTask;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,9 @@
|
||||||
'use strict';
|
const gulp = require('gulp');
|
||||||
|
const david = require('gulp-david');
|
||||||
|
|
||||||
const gulp = require('gulp'),
|
function checkDepsTask() {
|
||||||
david = require('gulp-david');
|
gulp.task('check-deps', function checkDeps() {
|
||||||
|
gulp.src('package.json').pipe(david());
|
||||||
function checkDepsTask(){
|
|
||||||
gulp.task('check-deps', function checkDeps(){
|
|
||||||
gulp
|
|
||||||
.src('package.json')
|
|
||||||
.pipe(david());
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
'use strict';
|
const gulp = require('gulp');
|
||||||
|
const del = require('del');
|
||||||
|
|
||||||
const gulp = require('gulp'),
|
function dupeTask(options) {
|
||||||
del = require('del');
|
gulp.task('dupe', function() {
|
||||||
|
|
||||||
function dupeTask(options){
|
|
||||||
gulp.task('dupe', function(){
|
|
||||||
del.sync([options.workingDir]);
|
del.sync([options.workingDir]);
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,18 @@
|
||||||
'use strict';
|
const gulp = require('gulp');
|
||||||
|
const less = require('gulp-less');
|
||||||
|
const autoprefixer = require('gulp-autoprefixer');
|
||||||
|
const rename = require('gulp-rename');
|
||||||
|
|
||||||
const gulp = require('gulp'),
|
function lessTask(options) {
|
||||||
less = require('gulp-less'),
|
|
||||||
autoprefixer = require('gulp-autoprefixer'),
|
|
||||||
rename = require('gulp-rename');
|
|
||||||
|
|
||||||
function lessTask(options){
|
|
||||||
// Requires: dupe.
|
// Requires: dupe.
|
||||||
gulp.task(
|
gulp.task('less', function() {
|
||||||
'less',
|
return options
|
||||||
function() {
|
.src(options.workingDir + '/**/*.less')
|
||||||
return options
|
.pipe(less())
|
||||||
.src(options.workingDir + '/**/*.less')
|
.pipe(autoprefixer())
|
||||||
.pipe(less())
|
.pipe(rename({ extname: '.css' }))
|
||||||
.pipe(autoprefixer())
|
.pipe(gulp.dest(options.workingDir));
|
||||||
.pipe(rename({ extname: '.css' }))
|
});
|
||||||
.pipe(gulp.dest(options.workingDir));
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = lessTask;
|
module.exports = lessTask;
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,14 @@
|
||||||
'use strict';
|
const gulp = require('gulp');
|
||||||
|
const jsonlint = require('gulp-jsonlint');
|
||||||
|
|
||||||
const gulp = require('gulp'),
|
function lintTask(options) {
|
||||||
jsonlint = require("gulp-jsonlint");
|
|
||||||
|
|
||||||
function lintTask(options){
|
|
||||||
// Requiers: dupe.
|
// Requiers: dupe.
|
||||||
gulp.task(
|
gulp.task('lint', function() {
|
||||||
'lint',
|
return options
|
||||||
function() {
|
.src(options.workingDir + '/**/conf.json')
|
||||||
return options
|
.pipe(jsonlint())
|
||||||
.src(options.workingDir + '/**/conf.json')
|
.pipe(jsonlint.reporter());
|
||||||
.pipe(jsonlint())
|
});
|
||||||
.pipe(jsonlint.reporter());
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = lintTask;
|
module.exports = lintTask;
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,17 @@
|
||||||
'use strict';
|
const gulp = require('gulp');
|
||||||
|
const postcss = require('gulp-postcss');
|
||||||
|
const autoprefixer = require('autoprefixer');
|
||||||
|
|
||||||
const gulp = require('gulp'),
|
function postcssTask(options) {
|
||||||
postcss = require('gulp-postcss'),
|
|
||||||
autoprefixer = require('autoprefixer');
|
|
||||||
|
|
||||||
function postcssTask(options){
|
|
||||||
// Requires: dupe.
|
// Requires: dupe.
|
||||||
gulp.task(
|
gulp.task('postcss', function() {
|
||||||
'postcss',
|
var processors = [autoprefixer()];
|
||||||
function() {
|
|
||||||
var processors = [
|
|
||||||
autoprefixer()
|
|
||||||
];
|
|
||||||
|
|
||||||
return options
|
return options
|
||||||
.src(options.workingDir + '/**/*.css')
|
.src(options.workingDir + '/**/*.css')
|
||||||
.pipe(postcss(processors))
|
.pipe(postcss(processors))
|
||||||
.pipe(gulp.dest(options.workingDir));
|
.pipe(gulp.dest(options.workingDir));
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = postcssTask;
|
module.exports = postcssTask;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use strict';
|
const gulp = require('gulp');
|
||||||
|
const autoprefixer = require('gulp-autoprefixer');
|
||||||
const gulp = require('gulp'),
|
const sass = require('gulp-sass');
|
||||||
autoprefixer = require('gulp-autoprefixer'),
|
const rename = require('gulp-rename');
|
||||||
sass = require('gulp-sass'),
|
|
||||||
rename = require('gulp-rename');
|
|
||||||
|
|
||||||
function sassTask(options) {
|
function sassTask(options) {
|
||||||
// Requires: dupe.
|
// Requires: dupe.
|
||||||
|
|
@ -13,9 +11,7 @@ function sassTask(options) {
|
||||||
return options
|
return options
|
||||||
.src(options.workingDir + '/**/*.scss')
|
.src(options.workingDir + '/**/*.scss')
|
||||||
.pipe(sass())
|
.pipe(sass())
|
||||||
.pipe(
|
.pipe(autoprefixer())
|
||||||
autoprefixer()
|
|
||||||
)
|
|
||||||
.pipe(rename({ extname: '.css' }))
|
.pipe(rename({ extname: '.css' }))
|
||||||
.pipe(gulp.dest(options.workingDir));
|
.pipe(gulp.dest(options.workingDir));
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -2,37 +2,55 @@ const test = require('ava');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
test('dark signature output', async (t) => {
|
test('dark signature output', async t => {
|
||||||
const expected = fs.readFileSync(path.resolve('tests/sample/dark/signature-dark.html'));
|
const expected = fs.readFileSync(
|
||||||
|
path.resolve('tests/sample/dark/signature-dark.html')
|
||||||
|
);
|
||||||
const built = fs.readFileSync(path.resolve('dist/dark/signature-dark.html'));
|
const built = fs.readFileSync(path.resolve('dist/dark/signature-dark.html'));
|
||||||
|
|
||||||
t.deepEqual(expected, built);
|
t.deepEqual(expected, built);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('dark signature reply output', async (t) => {
|
test('dark signature reply output', async t => {
|
||||||
const expected = fs.readFileSync(path.resolve('tests/sample/dark/signature-reply-dark.html'));
|
const expected = fs.readFileSync(
|
||||||
const built = fs.readFileSync(path.resolve('dist/dark/signature-reply-dark.html'));
|
path.resolve('tests/sample/dark/signature-reply-dark.html')
|
||||||
|
);
|
||||||
|
const built = fs.readFileSync(
|
||||||
|
path.resolve('dist/dark/signature-reply-dark.html')
|
||||||
|
);
|
||||||
|
|
||||||
t.deepEqual(expected, built);
|
t.deepEqual(expected, built);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('light signature output', async (t) => {
|
test('light signature output', async t => {
|
||||||
const expected = fs.readFileSync(path.resolve('tests/sample/light/signature-light.html'));
|
const expected = fs.readFileSync(
|
||||||
const built = fs.readFileSync(path.resolve('dist/light/signature-light.html'));
|
path.resolve('tests/sample/light/signature-light.html')
|
||||||
|
);
|
||||||
|
const built = fs.readFileSync(
|
||||||
|
path.resolve('dist/light/signature-light.html')
|
||||||
|
);
|
||||||
|
|
||||||
t.deepEqual(expected, built);
|
t.deepEqual(expected, built);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('light signature reply output', async (t) => {
|
test('light signature reply output', async t => {
|
||||||
const expected = fs.readFileSync(path.resolve('tests/sample/light/signature-reply-light.html'));
|
const expected = fs.readFileSync(
|
||||||
const built = fs.readFileSync(path.resolve('dist/light/signature-reply-light.html'));
|
path.resolve('tests/sample/light/signature-reply-light.html')
|
||||||
|
);
|
||||||
|
const built = fs.readFileSync(
|
||||||
|
path.resolve('dist/light/signature-reply-light.html')
|
||||||
|
);
|
||||||
|
|
||||||
t.deepEqual(expected, built);
|
t.deepEqual(expected, built);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('light full mail output', async (t) => {
|
test('light full mail output', async t => {
|
||||||
const expected = fs.readFileSync(path.resolve('tests/sample/light/full-mail-light.html'));
|
const expected = fs.readFileSync(
|
||||||
const built = fs.readFileSync(path.resolve('dist/light/full-mail-light.html'));
|
path.resolve('tests/sample/light/full-mail-light.html')
|
||||||
|
);
|
||||||
|
const built = fs.readFileSync(
|
||||||
|
path.resolve('dist/light/full-mail-light.html')
|
||||||
|
);
|
||||||
|
|
||||||
t.deepEqual(expected, built);
|
t.deepEqual(expected, built);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue