Skip to content

Commit

Permalink
feat: update chalk to 4.1.0
Browse files Browse the repository at this point in the history
closes #322

closes #322
  • Loading branch information
jlengrand committed Oct 8, 2020
1 parent b0674bd commit b0b5c3c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"babel-loader": "8.1.0",
"babel-runtime": "6.26.0",
"case-sensitive-paths-webpack-plugin": "2.3.0",
"chalk": "2.4.2",
"chalk": "4.1.0",
"cli-table": "0.3.1",
"connect-history-api-fallback": "1.6.0",
"copy-webpack-plugin": "5.1.2",
Expand Down
8 changes: 4 additions & 4 deletions scripts/utils/formatElmCompilerErrors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var chalk = require('chalk');
var ctx = new chalk.constructor({ enabled: true });
var ctx = new chalk.Instance({ enabled: true });
var error = ctx.bold.red;
var filename = ctx.cyan;
var isBrowser = typeof window === 'object';
Expand All @@ -28,16 +28,16 @@ module.exports = function formatElmCompilerErrors(messages) {
return errors.length > 0
? {
errors: errors
.map(x =>
.map((x) =>
x
.replace(/(--\s[A-Z\s]+-+\s.*\.elm\r?\n)/g, filename('$1'))
.replace(/(\n\s*)(\^+)/g, '$1' + error('$2'))
.replace(/(\d+)(\|>)/g, '$1' + error('$2'))
)
.map(stripRedundantInfo)
// drop errors that only contain whitespace
.filter(err => err.trim()),
warnings: warnings
.filter((err) => err.trim()),
warnings: warnings,
}
: messages;
};
11 changes: 6 additions & 5 deletions tests/elm-app.eject.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const testAppDir = path.join(rootDir, testAppName);
const createElmAppCmd = path.join(rootDir, 'bin/create-elm-app-cli.js');
const elmAppCmd = path.join(rootDir, 'bin/elm-app-cli.js');

describe('Ejecting Elm application. (Please wait...)', function() {
describe('Ejecting Elm application. (Please wait...)', function () {
this.timeout(60000);

before(done => {
before((done) => {
const { status } = spawn.sync('node', [createElmAppCmd, testAppName]);
if (status === 0) {
process.chdir(testAppDir);
Expand All @@ -33,7 +33,7 @@ describe('Ejecting Elm application. (Please wait...)', function() {
it(`'elm-app eject' should succeed in '${testAppName}'`, () => {
const { status, output } = spawn.sync('node', [elmAppCmd, 'eject']);
const outputString = output
.map(out => (out !== null ? out.toString() : ''))
.map((out) => (out !== null ? out.toString() : ''))
.join('');

expect(status, 'to be', 0);
Expand All @@ -50,7 +50,7 @@ describe('Ejecting Elm application. (Please wait...)', function() {
start: 'node scripts/start.js',
make: 'elm make',
repl: 'elm repl',
reactor: 'elm reactor'
reactor: 'elm reactor',
});
});

Expand All @@ -77,9 +77,10 @@ describe('Ejecting Elm application. (Please wait...)', function() {
it('It should be possible to build ejected application, using npm scripts', () => {
const { status, output } = spawn.sync('npm', ['run', 'build']);
const outputString = output
.map(out => (out !== null ? out.toString() : ''))
.map((out) => (out !== null ? out.toString() : ''))
.join('');

console.log(outputString);
expect(status, 'to be', 0);
expect(outputString, 'to contain', 'Compiled successfully');
}).timeout(5 * 60 * 1000);
Expand Down

0 comments on commit b0b5c3c

Please sign in to comment.