cloverfield-tools / cf-package

Cloverfield Package Scaffold
MIT License
98 stars 14 forks source link

[#28] Windows compatibility #29

Closed nkbt closed 9 years ago

nkbt commented 9 years ago

I've run every npm script on my Win machine and they all work fine now.

Here are results of previously failing ones:

npm test

C:\www\cf-package (master)
λ npm test

> cf-package@1.0.0 test C:\www\cf-package
> babel-node node_modules/blue-tape/bin/blue-tape test/**/*-test.js

TAP version 13
# Generate
ok 1 should be function
ok 2 should return function
Processing test {{x.y}}
ok 3 should fill template with values
Processing test {{x.y}}
Processing another {{x.y}}
ok 4 should fill multiple templates with values
# Parse props
ok 5 should be function
ok 6 should return function
ok 7 should parse dot-delimited props into nested objects
ok 8 should merge parsed data into defaults object

1..8
# tests 8
# pass  8

# ok

npm run cov


C:\www\cf-package (win)
λ npm run cov

> cf-package@1.0.0 precov C:\www\cf-package
> rimraf coverage

> cf-package@1.0.0 cov C:\www\cf-package
> babel-node node_modules/isparta/bin/isparta cover --report text --report html test

TAP version 13
# Generate
ok 1 should be function
ok 2 should return function
Processing test {{x.y}}
ok 3 should fill template with values
Processing test {{x.y}}
Processing another {{x.y}}
ok 4 should fill multiple templates with values
# Parse props
ok 5 should be function
ok 6 should return function
ok 7 should parse dot-delimited props into nested objects
ok 8 should merge parsed data into defaults object
================================================================================
Writing coverage object [C:\www\cf-package\coverage\coverage.json]
Writing coverage reports at [C:\www\cf-package\coverage]
================================================================================
----------------|----------|----------|----------|----------|----------------|
File            |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------------|----------|----------|----------|----------|----------------|
 lib\           |      100 |      100 |      100 |      100 |                |
  generate.js   |      100 |      100 |      100 |      100 |                |
  parseProps.js |      100 |      100 |      100 |      100 |                |
----------------|----------|----------|----------|----------|----------------|
All files       |      100 |      100 |      100 |      100 |                |
----------------|----------|----------|----------|----------|----------------|

=============================== Coverage summary ===============================
Statements   : 100% ( 50/50 ), 20 ignored
Branches     : 100% ( 22/22 ), 13 ignored
Functions    : 100% ( 11/11 ), 1 ignored
Lines        : 100% ( 8/8 )
================================================================================

npm run test:dev

C:\www\cf-package (win)
λ npm run test:dev

> cf-package@1.0.0 test:dev C:\www\cf-package
> npm test | faucet

# Generate
  ok 1 should be function
  ok 2 should return function
  ok 3 should fill template with values
✓ Generateuld fill multiple templates with values

# Parse props
  ok 5 should be function
  ok 6 should return function
  ok 7 should parse dot-delimited props into nested objects
✓ Parse props merge parsed data into defaults object

# tests 8
tests 8
# pass  8
pass  8
✓ ok
nkbt commented 9 years ago

ping @forresst

forresst commented 9 years ago

LGTM. This works great on windows.

The output is a little different for npm run test:dev

Here are the results of my tests :

npm test

c:\lab\cf-package>npm test

> cf-package@1.0.0 test c:\lab\cf-package
> babel-node node_modules/blue-tape/bin/blue-tape test/**/*-test.js

TAP version 13
# Generate
ok 1 should be function
ok 2 should return function
ok 3 should fill template with values
ok 4 should fill multiple templates with values
# Parse props
ok 5 should be function
ok 6 should return function
ok 7 should parse dot-delimited props into nested objects
ok 8 should merge parsed data into defaults object

1..8
# tests 8
# pass  8

# ok

npm run cov

> cf-package@1.0.0 precov c:\lab\cf-package
> rimraf coverage

> cf-package@1.0.0 cov c:\lab\cf-package
> babel-node node_modules/isparta/bin/isparta cover --report text --report html
test

TAP version 13
# Generate
ok 1 should be function
ok 2 should return function
ok 3 should fill template with values
ok 4 should fill multiple templates with values
# Parse props
ok 5 should be function
ok 6 should return function
ok 7 should parse dot-delimited props into nested objects
ok 8 should merge parsed data into defaults object
================================================================================

Writing coverage object [c:\lab\cf-package\coverage\coverage.json]
Writing coverage reports at [c:\lab\cf-package\coverage]
================================================================================

----------------|----------|----------|----------|----------|----------------|
File            |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------------|----------|----------|----------|----------|----------------|
 lib\           |      100 |      100 |      100 |      100 |                |
  generate.js   |      100 |      100 |      100 |      100 |                |
  parseProps.js |      100 |      100 |      100 |      100 |                |
----------------|----------|----------|----------|----------|----------------|
All files       |      100 |      100 |      100 |      100 |                |
----------------|----------|----------|----------|----------|----------------|

=============================== Coverage summary ===============================

Statements   : 100% ( 49/49 ), 20 ignored
Branches     : 100% ( 20/20 ), 13 ignored
Functions    : 100% ( 10/10 ), 1 ignored
Lines        : 100% ( 8/8 )
================================================================================

npm run test:dev

> cf-package@1.0.0 test:dev c:\lab\cf-package
> npm test | faucet

V Generate
V Parse props
# tests 8
# pass  8
V ok
nkbt commented 9 years ago

I'm using Cmder (ConEmu + Clink), which is at least bearable under Win to some extent. So it might have a little better support of CLI functionality.

forresst commented 9 years ago

Yes ! It's certain ! But it is not a problem, it works correctly.