dependabot[bot] on github_actions
dependabot[bot] on github_actions
Bump peter-evans/create-pull-re… (compare)
rush
is updated to generate different content, my yeoman generator will pick up those changes for free.
generator-your-unique-name
, I named it using a scoped package name convention (I looked through you GitHub repository and saw that you added scoped package name support in your v2.4.0 release). However, my generator still isn’t showing up on the Yeoman website. Is there anything special/extra that I need to do for Yeoman to pick up my generator?
oclif:component1
);Hey folks - question: i'm trying to use the yeoman-test
createGenerator helper method. But i get:
TypeError: console.Console is not a constructor
at new TerminalAdapter (/work/spaces/generator-test/node_modules/yeoman-environment/lib/adapter.js:24:39)
I tried to base my logic off of the tests here: https://github.com/yeoman/yeoman-test/blob/bb820da630d9d7ee8d9e7898848e896427e25675/test/helpers.js#L41-L70 but while that works when i run locally, my generator tests don't work.. Any thoughts?
yeoman-environment
in node_modules
, then print the options.console
out.Hello all, I have started to use yeoman to generate a project and had little issues so far aside from testing. Writing tests is something I'm still learning about but the issue I'm having I just can't seem to make sense of a solution or find more relevant information online or on the docs, I wonder if someone could help me since I'm really curious to know what can be done to solve it and would be a great lesson for me.
How to test this generator properly
The generator makes one or more requests to download a few .zip
files, extracts them and copies them to a directory. This can take a variable amount of time and when I write a test to assert file presence what ends up happening is that the assertions occur while the files are still being downloaded.
The code of my generator is open source and can be found here: https://github.com/csalmeida/generator-hozokit/blob/generate-hozokit/generators/app/index.js
This is the test I attempted to write (tried a few more things but all of them have similar results).
'use strict';
const path = require('path');
const assert = require('yeoman-assert');
const helpers = require('yeoman-test');
describe('generator-hozokit:app', () => {
beforeAll(() => {
return helpers
.run(path.join(__dirname, '../generators/app'))
.withPrompts({ projectName: 'Hozokit Test', installWordpress: false })
.then(function() {
// Checks that Hozokit was successfully extracted and present.
assert.file(['../hozokit-test/wp-content/themes/hozokit-test', '../hozokit-test/wp-content/themes/hozokit-test/index.php', '../hozokit-test/wp-content/themes/hozokit-test/templates/base.twig']);
// Checks that Wordpres has not been installed.
assert.noFile(['wp-login.php', 'index.php', 'wp-includes']);
// Checks that no zip files remain on the system.
assert.noFile(['*.zip',]);
});
});
});
It also seems that the examples in the docs are written in Mocha but the generator ships with Jest?
Any help from someone experienced in this would be deeply appreciated! 🙏
npm install --global yo
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated axios@0.18.1: Critical security vulnerability fixed in v0.21.1. For more information, see axios/axios#3410
added 728 packages, and audited 729 packages in 35s
34 packages are looking for funding
run npm fund
for details
4 high severity vulnerabilities