Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

yvbeek
Copy link

@yvbeek yvbeek commented Jun 11, 2019

I've updated the dependencies and ran the tests.
This should fix the flatten dependency warning.

@yvbeek
Copy link
Author

yvbeek commented Jun 12, 2019

Hmmm, it turns out the tests fail.

I'm trying to upgrade the code for the newer postcss-values-parser version. But I have no clue why the test command keeps failing:

> [email protected] test:tape /Users/Z/Projects/PostCSS-Color-Gray
> postcss-tape

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:tape: `postcss-tape`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] test:tape script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Z/.npm/_logs/2019-06-12T01_27_09_403Z-debug.log

The log file contains:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/Cellar/node/12.4.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'test:tape'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'pretest:tape', 'test:tape', 'posttest:tape' ]
5 info lifecycle [email protected]~pretest:tape: [email protected]
6 info lifecycle [email protected]~test:tape: [email protected]
7 verbose lifecycle [email protected]~test:tape: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~test:tape: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/Z/Projects/PostCSS-Color-Gray/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/Z/Projects/PostCSS-Color-Gray/node_modules/.bin:/Users/Z/.rbenv/shims:/usr/local/opt/python/libexec/bin:/usr/local/sbin:/usr/local/bin:/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands
9 verbose lifecycle [email protected]~test:tape: CWD: /Users/Z/Projects/PostCSS-Color-Gray
10 silly lifecycle [email protected]~test:tape: Args: [ '-c', 'postcss-tape' ]
11 silly lifecycle [email protected]~test:tape: Returned: code: 1  signal: null
12 info lifecycle [email protected]~test:tape: Failed to exec test:tape script
13 verbose stack Error: [email protected] test:tape: `postcss-tape`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:200:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:200:13)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/Z/Projects/PostCSS-Color-Gray
16 verbose Darwin 18.6.0
17 verbose argv "/usr/local/Cellar/node/12.4.0/bin/node" "/usr/local/bin/npm" "run" "test:tape"
18 verbose node v12.4.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] test:tape: `postcss-tape`
22 error Exit status 1
23 error Failed at the [email protected] test:tape script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

The log seems to indicate that the tests exit with status 1, but it doesn't provide any useful information on what is going wrong 😒

The part of the code that is incompatible with the new version of postcss-values-parser is the appending of commas and numbers e.g. // replace the contents of rgb with (r,g,b)

Amongst a few other changes, I think the code can be changed from:

// replace the contents of rgb with `(r,g,b`
.append(openingSlash)
.append(parser.number({ value: r }))
.append(parser.comma({ value: ',' }))
.append(parser.number({ value: g }))
.append(parser.comma({ value: ',' }))
.append(parser.number({ value: b }))

to

import Numeric from 'postcss-values-parser/lib/nodes/Numeric';
import Punctuation from 'postcss-values-parser/lib/nodes/Punctuation';
// replace the contents of rgb with `(r,g,b`
.append(openingSlash)
.append(new Numeric({ value: r }))
.append(new Punctuation({ value: ',' }))
.append(new Numeric({ value: g }))
.append(new Punctuation({ value: ',' }))
.append(new Numeric({ value: b }));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant