Fix boostrap > bootstrap typo

This commit is contained in:
Convly 2022-11-16 11:08:08 +01:00
parent bffa65ebc2
commit 7768f6076c
5 changed files with 26 additions and 24 deletions

View File

@ -71,12 +71,12 @@ describe('SSO', () => {
jest.clearAllMocks();
});
test('Cannot register after boostrap', () => {
test('Cannot register after bootstrap', () => {
global.strapi = { isLoaded: true };
const fn = () => registry.register(fooProvider);
expect(fn).toThrowError(`You can't register new provider after the boostrap`);
expect(fn).toThrowError(`You can't register new provider after the bootstrap`);
expect(registry.size).toBe(0);
});

View File

@ -6,7 +6,7 @@ module.exports = () => {
Object.assign(registry, {
register(provider) {
if (strapi.isLoaded) {
throw new Error(`You can't register new provider after the boostrap`);
throw new Error(`You can't register new provider after the bootstrap`);
}
this.set(provider.uid, provider);

View File

@ -57,7 +57,7 @@ class TransferEngine implements ITransferEngine {
);
}
async boostrap(): Promise<void> {
async bootstrap(): Promise<void> {
await Promise.all([
// bootstrap source provider
this.sourceProvider.bootstrap?.(),
@ -115,7 +115,7 @@ class TransferEngine implements ITransferEngine {
async transfer(): Promise<void> {
try {
// Bootstrap the providers
await this.boostrap();
await this.bootstrap();
// Resolve providers' resource and store
// them in the engine's internal state

View File

@ -6,7 +6,7 @@ import { collect, createMockedQueryBuilder, getStrapiFactory } from './test-util
import { createLocalStrapiSourceProvider } from '../';
describe('Local Strapi Source Provider', () => {
describe('Boostrap', () => {
describe('Bootstrap', () => {
test('Should not have a defined Strapi instance if bootstrap has not been called', () => {
const provider = createLocalStrapiSourceProvider({ getStrapi: getStrapiFactory() });
@ -128,24 +128,24 @@ describe('Local Strapi Source Provider', () => {
bar: { uid: 'bar', attributes: { age: { type: 'number' } } },
};
const components ={
const components = {
'basic.simple': {
collectionName: 'components_basic_simples',
info: { displayName: 'simple', icon: 'ambulance', description: '' },
options: {},
attributes: { name: {type:'string'} },
attributes: { name: { type: 'string' } },
uid: 'basic.simple',
category: 'basic',
modelType: 'component',
modelName: 'simple',
globalId: 'ComponentBasicSimple'
globalId: 'ComponentBasicSimple',
},
'blog.test-como': {
collectionName: 'components_blog_test_comos',
info: {
displayName: 'test comp',
icon: 'air-freshener',
description: ''
description: '',
},
options: {},
attributes: { name: { type: 'string' } },
@ -153,14 +153,16 @@ describe('Local Strapi Source Provider', () => {
category: 'blog',
modelType: 'component',
modelName: 'test-como',
globalId: 'ComponentBlogTestComo'
globalId: 'ComponentBlogTestComo',
},
}
};
const provider = createLocalStrapiSourceProvider({ getStrapi: getStrapiFactory({
contentTypes,
components
}) });
const provider = createLocalStrapiSourceProvider({
getStrapi: getStrapiFactory({
contentTypes,
components,
}),
});
await provider.bootstrap();
@ -177,19 +179,19 @@ describe('Local Strapi Source Provider', () => {
collectionName: 'components_basic_simples',
info: { displayName: 'simple', icon: 'ambulance', description: '' },
options: {},
attributes: { name: {type:'string'} },
attributes: { name: { type: 'string' } },
uid: 'basic.simple',
category: 'basic',
modelType: 'component',
modelName: 'simple',
globalId: 'ComponentBasicSimple'
globalId: 'ComponentBasicSimple',
},
{
collectionName: 'components_blog_test_comos',
info: {
displayName: 'test comp',
icon: 'air-freshener',
description: ''
description: '',
},
options: {},
attributes: { name: { type: 'string' } },
@ -197,9 +199,9 @@ describe('Local Strapi Source Provider', () => {
category: 'blog',
modelType: 'component',
modelName: 'test-como',
globalId: 'ComponentBlogTestComo'
}
])
globalId: 'ComponentBlogTestComo',
},
]);
});
})
});
});

View File

@ -39,7 +39,7 @@ export interface ITransferEngine {
* Note: The bootstrap method can be used to initialize database
* connections, open files, etc...
*/
boostrap(): Promise<void>;
bootstrap(): Promise<void>;
/**
* Run the close lifecycle method of each provider