Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests fail on npm v6.5.0 / node v11.8.0 #3

Open
wu-lee opened this issue Jan 30, 2019 · 0 comments
Open

tests fail on npm v6.5.0 / node v11.8.0 #3

wu-lee opened this issue Jan 30, 2019 · 0 comments

Comments

@wu-lee
Copy link

wu-lee commented Jan 30, 2019

Having added mocha as a dependency, as per #2, I get test failures. In fact none seem to pass at all. This is on Ubuntu Xenial.

Output below:

> [email protected] pretest ~/metalsmith-assets-copy
> npm -s run build

src/index.js -> lib/index.js

> [email protected] test ~/metalsmith-assets-copy
> mocha --reporter spec



  metalsmith-assets-improved
    (when given a configuration object)
      1) copies files from the default source directory to the default destination directory
      2) copies files from a configured source directory to a configured destination directory
      3) does not overwrite files when no "replace" option is given
      4) does not overwrite files when the "replace" option is set to "none"
      5) overwrites files when the "replace" option is set to "all"
      6) only overwrites older files when the "replace" option is set to "old"
      7) overwrites files in a custom directory when the "replace" option is set to "all"
      8) only overwrites older files in a custom directory when the "replace" option is set to "old"
    (when given an array of configuration objects)
      - copies files from all configured source directories to all configured destination directories
      - correctly observes the "replace" option of each config object


  0 passing (251ms)
  2 pending
  8 failing

  1) metalsmith-assets-improved
       (when given a configuration object)
         copies files from the default source directory to the default destination directory:
     TypeError: Cannot destructure property `replace` of 'undefined' or 'null'.
      at metalsmith_assets_copy (src/index.js:57:74)
      at Context.<anonymous> (test/index.js:27:22)

  2) metalsmith-assets-improved
       (when given a configuration object)
         copies files from a configured source directory to a configured destination directory:
     Uncaught AssertionError: expected 0 to be above 0
      at Object.compareFileStats (test/lib/test-functions.js:46:44)
      at Metalsmith.<anonymous> (test/index.js:49:12)
      at Immediate.<anonymous> (node_modules/unyield/node_modules/co/index.js:52:14)

  3) metalsmith-assets-improved
       (when given a configuration object)
         does not overwrite files when no "replace" option is given:
     TypeError: Cannot destructure property `replace` of 'undefined' or 'null'.
      at metalsmith_assets_copy (src/index.js:57:74)
      at Context.<anonymous> (test/index.js:64:14)

  4) metalsmith-assets-improved
       (when given a configuration object)
         does not overwrite files when the "replace" option is set to "none":
     Uncaught AssertionError: expected [ Array(3) ] to be a superset of [ Array(7) ]
      at Object.compareFileStats (test/lib/test-functions.js:47:46)
      at Metalsmith.<anonymous> (test/index.js:95:14)
      at Immediate.<anonymous> (node_modules/unyield/node_modules/co/index.js:52:14)

  5) metalsmith-assets-improved
       (when given a configuration object)
         overwrites files when the "replace" option is set to "all":

      Uncaught AssertionError: expected 2019-01-30T19:51:54.384+00:00 to be the same as 2019-01-30T19:56:43.015+00:00
      + expected - actual

      -2019-01-30T19:51:54.384+00:00
      +2019-01-30T19:56:43.015+00:00
      
      at expectedFiles.forEach.file (test/lib/test-functions.js:78:54)
      at Array.forEach (<anonymous>)
      at Object.compareFileStats (test/lib/test-functions.js:49:23)
      at Metalsmith.<anonymous> (test/index.js:120:14)
      at Immediate.<anonymous> (node_modules/unyield/node_modules/co/index.js:52:14)

  6) metalsmith-assets-improved
       (when given a configuration object)
         only overwrites older files when the "replace" option is set to "old":
     Uncaught AssertionError: expected [ Array(3) ] to be a superset of [ Array(7) ]
      at Object.compareFileStats (test/lib/test-functions.js:47:46)
      at Metalsmith.<anonymous> (test/index.js:145:14)
      at Immediate.<anonymous> (node_modules/unyield/node_modules/co/index.js:52:14)

  7) metalsmith-assets-improved
       (when given a configuration object)
         overwrites files in a custom directory when the "replace" option is set to "all":

      Uncaught AssertionError: expected 2019-01-30T19:51:54.408+00:00 to be the same as 2019-01-30T19:56:43.071+00:00
      + expected - actual

      -2019-01-30T19:51:54.408+00:00
      +2019-01-30T19:56:43.071+00:00
      
      at expectedFiles.forEach.file (test/lib/test-functions.js:78:54)
      at Array.forEach (<anonymous>)
      at Object.compareFileStats (test/lib/test-functions.js:49:23)
      at Metalsmith.<anonymous> (test/index.js:172:14)
      at Immediate.<anonymous> (node_modules/unyield/node_modules/co/index.js:52:14)

  8) metalsmith-assets-improved
       (when given a configuration object)
         only overwrites older files in a custom directory when the "replace" option is set to "old":
     Uncaught AssertionError: expected [ Array(2) ] to be a superset of [ Array(7) ]
      at Object.compareFileStats (test/lib/test-functions.js:47:46)
      at Metalsmith.<anonymous> (test/index.js:198:14)
      at Immediate.<anonymous> (node_modules/unyield/node_modules/co/index.js:52:14)



npm ERR! Test failed.  See above for more details.
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

No branches or pull requests

1 participant