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

[BUG] results of npmInstall is not reachable from generator testsuite #842

Open
duncdrum opened this issue Jul 5, 2022 · 0 comments
Open

Comments

@duncdrum
Copy link
Collaborator

duncdrum commented Jul 5, 2022

Describe the bug
i would have expected the unit test to run inside the completely generated app but that isn't the case, which is great for performance, but puts the actual number of declared dependencies in package.json out of reach of the testsuite.

Expected behavior
The fully modified package.json to be present when the tests are running.

To Reproduce
add this to any of the generated app specs.

const assert = require('yeoman-assert')
const helpers = require('yeoman-test')
const fs = require('fs-extra')

// this is a dummy test 
  describe('npm Install succeeds', function () {
    it('package json has 8 dev deps', function (done) {
      assert.fileContent('package.json', 'supertest')
      done()
    })

result

AssertionError [ERR_ASSERTION]: package.json did not match 'supertest'. Contained:

{
  "name": "foo",
  "version": "1.0.0",
  "description": "My amazing foo application",
  "homepage": "",
  "bugs": "",
  "engines": {
    "node": ">=14.0.0"
  },
  "keywords": [
    "exist",
    "exist-db",
    "xml",
    "xql",
    "xquery"
  ],
  "author": {
    "name": "tester",
    "email": "te@st.er"
  },
  "license": "MIT",
  "scripts": {
    "test": "mocha test/mocha/ --recursive --exit && mocha test/xqs/*.js",
    "cypress": "cypress run"
  },
  "repository": ""
}
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