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

docs: correct provide(s) typo in error #569

Merged
merged 2 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export default class Store {
private _getGenerator(module: any, meta: BaseGeneratorMeta) {
const Generator = module.default?.default ?? module.default ?? module;
if (typeof Generator !== 'function') {
throw new TypeError("The generator doesn't provides a constructor.");
throw new TypeError("The generator doesn't provide a constructor.");
}

Object.assign(Generator, meta);
Expand Down
2 changes: 1 addition & 1 deletion test/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
});

MockedGenerator = class MockedGenerator extends Generator {};
mockedDefault = sinon.stub();

Check warning on line 39 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18)

Caution: `sinon` also has a named export `stub`. Check if you meant to write `import {stub} from 'sinon'` instead

Check warning on line 39 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Caution: `sinon` also has a named export `stub`. Check if you meant to write `import {stub} from 'sinon'` instead

Check warning on line 39 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 20)

Caution: `sinon` also has a named export `stub`. Check if you meant to write `import {stub} from 'sinon'` instead

Check warning on line 39 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Caution: `sinon` also has a named export `stub`. Check if you meant to write `import {stub} from 'sinon'` instead

Check warning on line 39 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Caution: `sinon` also has a named export `stub`. Check if you meant to write `import {stub} from 'sinon'` instead

Check warning on line 39 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Caution: `sinon` also has a named export `stub`. Check if you meant to write `import {stub} from 'sinon'` instead
MockedGenerator.prototype.mockedDefault = mockedDefault;
});

Expand Down Expand Up @@ -246,7 +246,7 @@
});

it('should schedule generator queue', async function () {
this.env.queueTask = sinon.spy();

Check warning on line 249 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 249 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 249 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 249 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 249 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 249 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead
await this.env.composeWith('stub');
assert(this.env.queueTask.calledOnce);
assert(this.env.queueTask.getCall(0).firstArg === 'environment:run');
Expand All @@ -254,7 +254,7 @@

describe('passing false schedule parameter', () => {
it('should not schedule generator', async function () {
this.env.queueTask = sinon.spy();

Check warning on line 257 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 257 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 257 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 257 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 257 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 257 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead
await this.env.composeWith('stub', { generatorArgs: [], schedule: false });
if (isGreaterThan6(generatorVersion)) {
assert(this.env.queueTask.calledOnce);
Expand All @@ -266,7 +266,7 @@
});
describe('passing function schedule parameter', () => {
it('returning false should not schedule generator', async function () {
this.env.queueTask = sinon.spy();

Check warning on line 269 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 269 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 269 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 269 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 269 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 269 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead
await this.env.composeWith('stub', { generatorArgs: [], schedule: () => false });
if (isGreaterThan6(generatorVersion)) {
assert(this.env.queueTask.calledOnce);
Expand Down Expand Up @@ -372,7 +372,7 @@
};

const runName = isLegacyVersion(generatorVersion) ? 'run' : 'queueTasks';
this.runMethod = sinon.spy(Generator.prototype, runName);

Check warning on line 375 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 375 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 375 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 375 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 375 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 375 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead
this.env.registerStub(this.Stub, 'stub:run');
this.env.registerStub(this.WritingStub, 'writingstub:run');
this.env.registerStub(this.PromiseFailingStub, 'promisefailingstub:run');
Expand Down Expand Up @@ -463,7 +463,7 @@
return this.env.run('no-constructor:app').then(
() => assert.fail(),
error => {
expect(error.message).toMatch('provides a constructor');
expect(error.message).toMatch('provide a constructor');
},
);
});
Expand Down Expand Up @@ -557,7 +557,7 @@
describe('#run() a ts generator', () => {
beforeEach(async function () {
await this.env.register(path.join(__dirname, './fixtures/generator-ts/generators/app/index.ts'), 'ts:app');
this.runMethod = sinon.spy((await this.env.get('ts:app')).prototype, 'exec');

Check warning on line 560 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 560 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 560 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 560 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 560 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 560 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead
});

afterEach(function () {
Expand All @@ -575,7 +575,7 @@
beforeEach(async function () {
await this.env.register(path.join(__dirname, './fixtures/generator-common-js/generators/cjs/index.cjs'), 'common-js:cjs');
const Generator = await this.env.get('common-js:cjs');
this.runMethod = sinon.spy(Generator.prototype, 'default');

Check warning on line 578 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 578 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 578 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 578 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 578 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 20)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead

Check warning on line 578 in test/environment.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18)

Caution: `sinon` also has a named export `spy`. Check if you meant to write `import {spy} from 'sinon'` instead
this.postConstruct = sinon.spy(Generator.prototype, '_postConstruct');
});

Expand Down
Loading