Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikwilkowski committed Feb 2, 2020
2 parents d4bd321 + 994d553 commit 367d4c7
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 317 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ npm-debug.log
bin/
lib/
package-lock.json
.coveralls.yml
49 changes: 48 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,57 @@
language: node_js

os:
- linux
- osx
- linux

node_js:
- 10
- 12
- node

jobs:
fast_finish: true
include:
- name: "Windows node 10 build"
os: windows
node_js: 10
cache: false # windows cache uploads are slow
env: YARN_GPG=no # starts gpg-agent that never exits

- name: "Windows node 12 build"
os: windows
node_js: 12
cache: false # windows cache uploads are slow
env: YARN_GPG=no # starts gpg-agent that never exits

- name: "Windows node latest build"
os: windows
node_js: node
cache: false # windows cache uploads are slow
env: YARN_GPG=no # starts gpg-agent that never exits

- stage: Produce Coverage
node_js: node
os: osx
script: jest --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage

before_install:
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then powershell -command 'Set-MpPreference -DisableRealtimeMonitoring $true' ; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then export NODEPATH=$(where.exe node.exe) ; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then export PROJECTDIR=$(pwd) ; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then export YARNCACHE=$(yarn cache dir) ; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then export TEMPDIR=$LOCALAPPDATA\\Temp ; fi

- if [ "$TRAVIS_OS_NAME" = "windows" ]; then powershell Add-MpPreference -ExclusionProcess ${NODEPATH} ; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then powershell Add-MpPreference -ExclusionPath ${YARNCACHE} ; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then powershell Add-MpPreference -ExclusionPath ${PROJECTDIR} ; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then powershell Add-MpPreference -ExclusionPath ${TEMPDIR} ; fi

- if [ "$TRAVIS_OS_NAME" = "windows" ]; then echo "DisableArchiveScanning..." ; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableArchiveScanning \$true'" ; fi

- if [ "$TRAVIS_OS_NAME" = "windows" ]; then echo "DisableBehaviorMonitoring..." ; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableBehaviorMonitoring \$true'" ; fi

- if [ "$TRAVIS_OS_NAME" = "windows" ]; then echo "DisableRealtimeMonitoring..." ; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then powershell Start-Process -PassThru -Wait PowerShell -ArgumentList "'-Command Set-MpPreference -DisableRealtimeMonitoring \$true'" ; fi
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

<p align="center"><img src="https://raw.githubusercontent.com/dominikwilkowski/cfonts/master/img/example2.png" alt="api example"></p>
<p align="center"><a href="https://nodei.co/npm/cfonts/"><img src="https://nodei.co/npm/cfonts.png?downloads=true" alt="npm status"></a></p>
<p align="center"><a href="https://travis-ci.org/dominikwilkowski/cfonts"><img src="https://travis-ci.org/dominikwilkowski/cfonts.svg?branch=master" alt="build status"></a></p>
<p align="center">
<a href="https://travis-ci.org/dominikwilkowski/cfonts"><img src="https://travis-ci.org/dominikwilkowski/cfonts.svg?branch=master" alt="build status"></a>
<a href='https://coveralls.io/github/dominikwilkowski/cfonts?branch=master'><img src='https://coveralls.io/repos/github/dominikwilkowski/cfonts/badge.svg?branch=master' alt='CFont Coverage Status' /></a>
</p>

<p align="center">This is a silly little command line tool for sexy fonts in the console. <strong>Give your cli some love.</strong></p>

Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,23 @@
"test": "yarn build && yarn test:unit && yarn test:fonts",
"test:fonts": "node ./test/fonttest.js",
"test:watch": "jest --watchAll --coverage",
"test:unit": "FORCE_COLOR=3 jest",
"test:unit": "npx cross-env FORCE_COLOR=3 jest",
"test:types": "yarn types:clean && yarn types:declaration",
"build": "yarn build:lib && yarn build:bin",
"build:bin": "mkdir -p bin && mv lib/bin.js bin/index.js",
"build:lib": "mkdir -p lib && babel src --out-dir lib",
"build:bin": "npx mkdirp bin && mv lib/bin.js bin/index.js",
"build:lib": "npx mkdirp lib && babel src --out-dir lib",
"watch": "yarn build:lib && onchange 'src/**/*' -- yarn build:lib",
"types:clean": "find lib/ -type f -name '*.d.ts' -exec rm {} +",
"types:declaration": "tsc -p declaration.tsconfig.json",
"coveralls": "jest --coverage --coverageReporters=text-lcov | coveralls",
"nuke": "rm -rf lib && rm -rf node_modules && rm yarn.lock"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
"@types/node": "latest",
"coveralls": "^3.0.9",
"jest-cli": "^25.1.0",
"onchange": "^6.1.0",
"typescript": "^3.7.5"
Expand Down
4 changes: 2 additions & 2 deletions test/fonttest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// Dependencies
const { CHARS: CFontsChars, FONTFACES: CFontsFontfaces } = require('../src/constants.js');
const WinSize = require('window-size');
const { Size } = require('../src/Size.js');
const Readline = require('readline');
const Chalk = require(`chalk`);
const Path = require('path');
Expand Down Expand Up @@ -340,7 +340,7 @@ const Log = {
* @param {string} text - The name of the test
*/
headline: ( text ) => {
let space = Math.floor( ( WinSize.width - text.length - 6 ) / 2 );
let space = Math.floor( ( Size.width - text.length - 6 ) / 2 );
if( space < 0 ) {
space = 1;
}
Expand Down
2 changes: 2 additions & 0 deletions test/unit/Cli.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ test(`CLI - Calling Cli alone should output an error`, () => {
console.log = jest.fn();
console.error = jest.fn();

process.argv = ['node', 'script']; // we have to remove process.argv so args passed to our testing lib don't break our test

Cli();

expect( console.log.mock.calls.length ).toBe( 0 );
Expand Down
2 changes: 2 additions & 0 deletions test/unit/ParseArgs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ test(`ParseArgs - Return defaults without arguments`, () => {
"version": false,
};

process.argv = ['node', 'script']; // we have to remove process.argv so args passed to our testing lib don't break our test

expect( ParseArgs( options, [ 'node', 'script' ] ) ).toEqual( result );
expect( ParseArgs( options, [] ) ).toEqual( result );
expect( ParseArgs( options ) ).toEqual( result );
Expand Down

0 comments on commit 367d4c7

Please sign in to comment.