mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
- Working angular test environment
This commit is contained in:
parent
0ae6185400
commit
896f0b624c
@ -15,23 +15,23 @@ const config: Config.InitialOptions = {
|
||||
displayName: 'E2E',
|
||||
testEnvironment: 'node',
|
||||
testMatch: [
|
||||
// '<rootDir>/test/e2e/v2.fetch.spec.ts',
|
||||
// '<rootDir>/test/e2e/v2.xhr.spec.ts',
|
||||
// '<rootDir>/test/e2e/v2.node.spec.ts',
|
||||
// '<rootDir>/test/e2e/v2.axios.spec.ts',
|
||||
// '<rootDir>/test/e2e/v2.babel.spec.ts',
|
||||
'<rootDir>/test/e2e/v2.fetch.spec.ts',
|
||||
'<rootDir>/test/e2e/v2.xhr.spec.ts',
|
||||
'<rootDir>/test/e2e/v2.node.spec.ts',
|
||||
'<rootDir>/test/e2e/v2.axios.spec.ts',
|
||||
'<rootDir>/test/e2e/v2.babel.spec.ts',
|
||||
'<rootDir>/test/e2e/v2.angular.spec.ts',
|
||||
// '<rootDir>/test/e2e/v3.fetch.spec.ts',
|
||||
// '<rootDir>/test/e2e/v3.xhr.spec.ts',
|
||||
// '<rootDir>/test/e2e/v3.node.spec.ts',
|
||||
// '<rootDir>/test/e2e/v3.axios.spec.ts',
|
||||
// '<rootDir>/test/e2e/v3.babel.spec.ts',
|
||||
// '<rootDir>/test/e2e/v3.angular.spec.ts',
|
||||
// '<rootDir>/test/e2e/client.fetch.spec.ts',
|
||||
// '<rootDir>/test/e2e/client.xhr.spec.ts',
|
||||
// '<rootDir>/test/e2e/client.node.spec.ts',
|
||||
// '<rootDir>/test/e2e/client.axios.spec.ts',
|
||||
// '<rootDir>/test/e2e/client.babel.spec.ts',
|
||||
'<rootDir>/test/e2e/v3.fetch.spec.ts',
|
||||
'<rootDir>/test/e2e/v3.xhr.spec.ts',
|
||||
'<rootDir>/test/e2e/v3.node.spec.ts',
|
||||
'<rootDir>/test/e2e/v3.axios.spec.ts',
|
||||
'<rootDir>/test/e2e/v3.babel.spec.ts',
|
||||
'<rootDir>/test/e2e/v3.angular.spec.ts',
|
||||
'<rootDir>/test/e2e/client.fetch.spec.ts',
|
||||
'<rootDir>/test/e2e/client.xhr.spec.ts',
|
||||
'<rootDir>/test/e2e/client.node.spec.ts',
|
||||
'<rootDir>/test/e2e/client.axios.spec.ts',
|
||||
'<rootDir>/test/e2e/client.babel.spec.ts',
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
15786
package-lock.json
generated
15786
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -64,11 +64,17 @@
|
||||
"json-schema-ref-parser": "^9.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "13.1.4",
|
||||
"@angular/animations": "13.1.3",
|
||||
"@angular/cli": "13.1.4",
|
||||
"@angular/common": "13.1.3",
|
||||
"@angular/compiler": "13.1.3",
|
||||
"@angular/compiler-cli": "13.1.3",
|
||||
"@angular/core": "13.1.3",
|
||||
"@angular/forms": "13.1.3",
|
||||
"@angular/platform-browser": "13.1.3",
|
||||
"@angular/platform-browser-dynamic": "13.1.3",
|
||||
"@angular/router": "13.1.3",
|
||||
"@babel/cli": "7.16.8",
|
||||
"@babel/core": "7.16.12",
|
||||
"@babel/preset-env": "7.16.11",
|
||||
|
||||
@ -7,7 +7,7 @@ export const sendRequest = <T>(
|
||||
formData: FormData | undefined,
|
||||
headers: HttpHeaders
|
||||
): Observable<HttpResponse<T>> => {
|
||||
return http.request<T>(url, options.method, {
|
||||
return http.request<T>(options.method, url, {
|
||||
headers,
|
||||
body: body ?? formData,
|
||||
withCredentials: config.WITH_CREDENTIALS,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
{{#equals @root.httpClient 'angular'}}
|
||||
import { Injectable } from '@angular/core';
|
||||
import type { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import type { Observable } from 'rxjs';
|
||||
|
||||
{{/equals}}
|
||||
@ -28,17 +28,13 @@ import { request as __request } from '../core/request';
|
||||
export class {{{name}}}{{{@root.postfix}}} {
|
||||
{{#if @root.exportClient}}
|
||||
|
||||
private readonly httpRequest: BaseHttpRequest;
|
||||
|
||||
constructor(httpRequest: BaseHttpRequest) {
|
||||
constructor(private readonly httpRequest: BaseHttpRequest) {
|
||||
this.httpRequest = httpRequest;
|
||||
}
|
||||
{{/if}}
|
||||
{{#equals @root.httpClient 'angular'}}
|
||||
|
||||
private readonly http: HttpClient;
|
||||
|
||||
constructor(http: HttpClient) {
|
||||
constructor(private readonly http: HttpClient) {
|
||||
this.http = http;
|
||||
}
|
||||
{{/equals}}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
import 'zone.js';
|
||||
|
||||
// import { HttpClientModule } from '@angular/common/http';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
// import { BrowserModule } from '@angular/platform-browser';
|
||||
// import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { CollectionFormatService } from './services/CollectionFormatService';
|
||||
import { ComplexService } from './services/ComplexService';
|
||||
@ -25,10 +23,46 @@ import { TypesService } from './services/TypesService';
|
||||
selector: 'app-root',
|
||||
template: `<div>Angular</div>`,
|
||||
})
|
||||
export class AppComponent {}
|
||||
export class AppComponent {
|
||||
constructor(
|
||||
private readonly collectionFormatService: CollectionFormatService,
|
||||
private readonly complexServiceService: ComplexService,
|
||||
private readonly defaultServiceService: DefaultService,
|
||||
private readonly defaultsServiceService: DefaultsService,
|
||||
private readonly duplicateServiceService: DuplicateService,
|
||||
private readonly errorServiceService: ErrorService,
|
||||
private readonly headerServiceService: HeaderService,
|
||||
private readonly multipleTags1ServiceService: MultipleTags1Service,
|
||||
private readonly multipleTags2ServiceService: MultipleTags2Service,
|
||||
private readonly multipleTags3ServiceService: MultipleTags3Service,
|
||||
private readonly noContentServiceService: NoContentService,
|
||||
private readonly parametersServiceService: ParametersService,
|
||||
private readonly responseServiceService: ResponseService,
|
||||
private readonly simpleServiceService: SimpleService,
|
||||
private readonly typesServiceService: TypesService
|
||||
) {
|
||||
(window as any).api = {
|
||||
collectionFormatService,
|
||||
complexServiceService,
|
||||
defaultServiceService,
|
||||
defaultsServiceService,
|
||||
duplicateServiceService,
|
||||
errorServiceService,
|
||||
headerServiceService,
|
||||
multipleTags1ServiceService,
|
||||
multipleTags2ServiceService,
|
||||
multipleTags3ServiceService,
|
||||
noContentServiceService,
|
||||
parametersServiceService,
|
||||
responseServiceService,
|
||||
simpleServiceService,
|
||||
typesServiceService,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
// imports: [BrowserModule, HttpClientModule],
|
||||
imports: [BrowserModule, HttpClientModule],
|
||||
providers: [
|
||||
CollectionFormatService,
|
||||
ComplexService,
|
||||
@ -50,6 +84,6 @@ export class AppComponent {}
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
// platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
|
||||
console.log('oke');
|
||||
platformBrowserDynamic()
|
||||
.bootstrapModule(AppModule)
|
||||
.catch(err => console.error(err));
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { generate } from './scripts/generate';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v3.node', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('client/axios', 'v3', 'axios', false, false, 'AppClient');
|
||||
compileWithTypescript('client/axios', 'index.ts');
|
||||
cleanup('client/axios');
|
||||
await generateClient('client/axios', 'v3', 'axios', false, false, 'AppClient');
|
||||
compileWithTypescript('client/axios');
|
||||
await server.start('client/axios');
|
||||
}, 30000);
|
||||
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
import browser from './scripts/browser';
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithBabel } from './scripts/compileWithBabel';
|
||||
import { copy } from './scripts/copy';
|
||||
import { generate } from './scripts/generate';
|
||||
import { copyAsset } from './scripts/copyAsset';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v3.babel', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('client/babel', 'v3', 'fetch', true, true, 'AppClient');
|
||||
await copy('index.html', 'client/babel/index.html');
|
||||
await copy('main.ts', 'client/babel/main.ts');
|
||||
cleanup('client/babel');
|
||||
await generateClient('client/babel', 'v3', 'fetch', true, true, 'AppClient');
|
||||
copyAsset('index.html', 'client/babel/index.html');
|
||||
copyAsset('main.ts', 'client/babel/main.ts');
|
||||
compileWithBabel('client/babel');
|
||||
await server.start('client/babel');
|
||||
await browser.start();
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
import browser from './scripts/browser';
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { copy } from './scripts/copy';
|
||||
import { generate } from './scripts/generate';
|
||||
import { copyAsset } from './scripts/copyAsset';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v3.fetch', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('client/fetch', 'v3', 'fetch', false, false, 'AppClient');
|
||||
await copy('index.html', 'client/fetch/index.html');
|
||||
await copy('main.ts', 'client/fetch/main.ts');
|
||||
cleanup('client/fetch');
|
||||
await generateClient('client/fetch', 'v3', 'fetch', false, false, 'AppClient');
|
||||
copyAsset('index.html', 'client/fetch/index.html');
|
||||
copyAsset('main.ts', 'client/fetch/main.ts');
|
||||
compileWithTypescript('client/fetch');
|
||||
await server.start('client/fetch');
|
||||
await browser.start();
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { generate } from './scripts/generate';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v3.node', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('client/node', 'v3', 'node', false, false, 'AppClient');
|
||||
cleanup('client/node');
|
||||
await generateClient('client/node', 'v3', 'node', false, false, 'AppClient');
|
||||
compileWithTypescript('client/node');
|
||||
await server.start('client/node');
|
||||
}, 30000);
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
import browser from './scripts/browser';
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { copy } from './scripts/copy';
|
||||
import { generate } from './scripts/generate';
|
||||
import { copyAsset } from './scripts/copyAsset';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v3.xhr', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('client/xhr', 'v3', 'xhr', false, false, 'AppClient');
|
||||
await copy('index.html', 'client/xhr/index.html');
|
||||
await copy('main.ts', 'client/xhr/main.ts');
|
||||
cleanup('client/xhr');
|
||||
await generateClient('client/xhr', 'v3', 'xhr', false, false, 'AppClient');
|
||||
copyAsset('index.html', 'client/xhr/index.html');
|
||||
copyAsset('main.ts', 'client/xhr/main.ts');
|
||||
compileWithTypescript('client/xhr');
|
||||
await server.start('client/xhr');
|
||||
await browser.start();
|
||||
|
||||
24
test/e2e/scripts/buildAngularProject.ts
Normal file
24
test/e2e/scripts/buildAngularProject.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { sync } from 'cross-spawn';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
|
||||
export const buildAngularProject = (dir: string, name: string, output: string) => {
|
||||
const cwd = `./test/e2e/generated/${dir}/${name}/`;
|
||||
sync(
|
||||
'ng',
|
||||
[
|
||||
'build',
|
||||
'--output-path',
|
||||
output,
|
||||
'--optimization',
|
||||
'false',
|
||||
'--configuration',
|
||||
'development',
|
||||
'--source-map',
|
||||
'false',
|
||||
],
|
||||
{
|
||||
cwd: resolvePath(cwd),
|
||||
stdio: 'inherit',
|
||||
}
|
||||
);
|
||||
};
|
||||
8
test/e2e/scripts/cleanup.ts
Normal file
8
test/e2e/scripts/cleanup.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { rmSync } from 'fs';
|
||||
|
||||
export const cleanup = (dir: string) => {
|
||||
rmSync(`./test/e2e/generated/${dir}/`, {
|
||||
force: true,
|
||||
recursive: true,
|
||||
});
|
||||
};
|
||||
@ -11,7 +11,7 @@ import {
|
||||
} from 'typescript';
|
||||
|
||||
export const compileWithTypescript = (dir: string) => {
|
||||
const baseDir = `./test/e2e/generated/${dir}/`;
|
||||
const cwd = `./test/e2e/generated/${dir}/`;
|
||||
const tsconfig = {
|
||||
compilerOptions: {
|
||||
target: 'es2020',
|
||||
@ -37,7 +37,7 @@ export const compileWithTypescript = (dir: string) => {
|
||||
const configFileResult = parseJsonConfigFileContent(
|
||||
configFile.config,
|
||||
sys,
|
||||
resolve(process.cwd(), baseDir),
|
||||
resolve(process.cwd(), cwd),
|
||||
undefined,
|
||||
'tsconfig.json'
|
||||
);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { copyFileSync } from 'fs';
|
||||
|
||||
export const copy = (fileNameIn: string, fileNameOut: string) => {
|
||||
export const copyAsset = (fileNameIn: string, fileNameOut: string) => {
|
||||
copyFileSync(`./test/e2e/assets/${fileNameIn}`, `./test/e2e/generated/${fileNameOut}`);
|
||||
};
|
||||
@ -1,33 +1,43 @@
|
||||
import { spawn } from 'cross-spawn';
|
||||
import { sync } from 'cross-spawn';
|
||||
import { mkdirSync, rmSync } from 'fs';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
|
||||
export const createAngularProject = async (dir: string) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const child = spawn('ng', [
|
||||
export const createAngularProject = (dir: string, name: string) => {
|
||||
const cwd = `./test/e2e/generated/${dir}/`;
|
||||
mkdirSync(cwd, {
|
||||
recursive: true,
|
||||
});
|
||||
sync(
|
||||
'ng',
|
||||
[
|
||||
'new',
|
||||
'test',
|
||||
'--minimal true',
|
||||
'--style css',
|
||||
'--inline-style true',
|
||||
'--inline-template true',
|
||||
'--routing false',
|
||||
'--skip-install true',
|
||||
'--skip-tests true',
|
||||
'--commit false',
|
||||
name,
|
||||
'--minimal',
|
||||
'true',
|
||||
'--style',
|
||||
'css',
|
||||
'--inline-style',
|
||||
'true',
|
||||
'--inline-template',
|
||||
'true',
|
||||
'--routing',
|
||||
'false',
|
||||
'--skip-tests',
|
||||
'true',
|
||||
'--skip-install',
|
||||
'true',
|
||||
'--skip-git',
|
||||
'true',
|
||||
'--commit',
|
||||
'false',
|
||||
'--force',
|
||||
], {
|
||||
cwd: resolvePath(dir)
|
||||
});
|
||||
|
||||
child.stdout.on('data', console.log);
|
||||
child.stderr.on('data', console.error);
|
||||
|
||||
child.on('exit', code => {
|
||||
if (code !== 0) {
|
||||
reject(code);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
],
|
||||
{
|
||||
cwd: resolvePath(cwd),
|
||||
stdio: 'inherit',
|
||||
}
|
||||
);
|
||||
rmSync(`${cwd}/${name}/src/app/`, {
|
||||
recursive: true,
|
||||
});
|
||||
};
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { generate as __generate } from '../../../';
|
||||
|
||||
export const generate = async (
|
||||
export const generateClient = async (
|
||||
dir: string,
|
||||
version: string,
|
||||
client: 'fetch' | 'xhr' | 'node' | 'axios' | 'angular',
|
||||
@ -20,7 +20,33 @@ const start = async (dir: string) => {
|
||||
})
|
||||
);
|
||||
|
||||
// Serve the index.html file
|
||||
_app.use(
|
||||
'/js',
|
||||
express.static(`./test/e2e/generated/${dir}/`, {
|
||||
extensions: ['', 'js'],
|
||||
index: 'index.js',
|
||||
})
|
||||
);
|
||||
|
||||
// Serve static assets
|
||||
_app.get('/runtime.js', (req, res) => {
|
||||
res.sendFile(resolvePath(`./test/e2e/generated/${dir}/runtime.js`));
|
||||
});
|
||||
_app.get('/polyfills.js', (req, res) => {
|
||||
res.sendFile(resolvePath(`./test/e2e/generated/${dir}/polyfills.js`));
|
||||
});
|
||||
_app.get('/vendor.js', (req, res) => {
|
||||
res.sendFile(resolvePath(`./test/e2e/generated/${dir}/vendor.js`));
|
||||
});
|
||||
_app.get('/main.js', (req, res) => {
|
||||
res.sendFile(resolvePath(`./test/e2e/generated/${dir}/main.js`));
|
||||
});
|
||||
_app.get('/styles.css', (req, res) => {
|
||||
res.sendFile(resolvePath(`./test/e2e/generated/${dir}/styles.css`));
|
||||
});
|
||||
_app.get('/favicon.ico', (req, res) => {
|
||||
res.sendFile(resolvePath(`./test/e2e/generated/${dir}/favicon.ico`));
|
||||
});
|
||||
_app.get('/', (req, res) => {
|
||||
res.sendFile(resolvePath(`./test/e2e/generated/${dir}/index.html`));
|
||||
});
|
||||
|
||||
@ -1,18 +1,21 @@
|
||||
// import browser from './scripts/browser';
|
||||
// import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import browser from './scripts/browser';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { copy } from './scripts/copy';
|
||||
import { generate } from './scripts/generate';
|
||||
import { buildAngularProject } from './scripts/buildAngularProject';
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { copyAsset } from './scripts/copyAsset';
|
||||
import { createAngularProject } from './scripts/createAngularProject';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
import {createAngularProject} from "./scripts/createAngularProject";
|
||||
|
||||
describe('v2.angular', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v2/angular', 'v2', 'angular');
|
||||
// await copy('index.html', 'v2/angular/index.html');
|
||||
// await copy('main-angular.ts', 'v2/angular/main.ts');
|
||||
// compileWithTypescript('v2/angular');
|
||||
await createAngularProject('v2/angular/');
|
||||
await server.start('v2/angular');
|
||||
cleanup('v2/angular');
|
||||
createAngularProject('v2/angular', 'app');
|
||||
await generateClient('v2/angular/app/src', 'v2', 'angular');
|
||||
copyAsset('main-angular.ts', 'v2/angular/app/src/main.ts');
|
||||
buildAngularProject('v2/angular', 'app', 'dist');
|
||||
await server.start('v2/angular/app/dist');
|
||||
await browser.start();
|
||||
}, 30000);
|
||||
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { generate } from './scripts/generate';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v2.node', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v2/axios', 'v2', 'axios');
|
||||
cleanup('v2/axios');
|
||||
await generateClient('v2/axios', 'v2', 'axios');
|
||||
compileWithTypescript('v2/axios');
|
||||
await server.start('v2/axios');
|
||||
}, 30000);
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
import browser from './scripts/browser';
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithBabel } from './scripts/compileWithBabel';
|
||||
import { copy } from './scripts/copy';
|
||||
import { generate } from './scripts/generate';
|
||||
import { copyAsset } from './scripts/copyAsset';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v2.babel', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v2/babel', 'v2', 'fetch', true, true);
|
||||
await copy('index.html', 'v2/babel/index.html');
|
||||
await copy('main.ts', 'v2/babel/main.ts');
|
||||
cleanup('v2/babel');
|
||||
await generateClient('v2/babel', 'v2', 'fetch', true, true);
|
||||
copyAsset('index.html', 'v2/babel/index.html');
|
||||
copyAsset('main.ts', 'v2/babel/main.ts');
|
||||
compileWithBabel('v2/babel');
|
||||
await server.start('v2/babel');
|
||||
await browser.start();
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
import browser from './scripts/browser';
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { copy } from './scripts/copy';
|
||||
import { generate } from './scripts/generate';
|
||||
import { copyAsset } from './scripts/copyAsset';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v2.fetch', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v2/fetch', 'v2', 'fetch');
|
||||
await copy('index.html', 'v2/fetch/index.html');
|
||||
await copy('main.ts', 'v2/fetch/main.ts');
|
||||
cleanup('v2/fetch');
|
||||
await generateClient('v2/fetch', 'v2', 'fetch');
|
||||
copyAsset('index.html', 'v2/fetch/index.html');
|
||||
copyAsset('main.ts', 'v2/fetch/main.ts');
|
||||
compileWithTypescript('v2/fetch');
|
||||
await server.start('v2/fetch');
|
||||
await browser.start();
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { generate } from './scripts/generate';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v2.node', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v2/node', 'v2', 'node');
|
||||
cleanup('v2/node');
|
||||
await generateClient('v2/node', 'v2', 'node');
|
||||
compileWithTypescript('v2/node');
|
||||
await server.start('v2/node');
|
||||
}, 30000);
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
import browser from './scripts/browser';
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { copy } from './scripts/copy';
|
||||
import { generate } from './scripts/generate';
|
||||
import { copyAsset } from './scripts/copyAsset';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v2.xhr', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v2/xhr', 'v2', 'xhr');
|
||||
await copy('index.html', 'v2/xhr/index.html');
|
||||
await copy('main.ts', 'v2/xhr/main.ts');
|
||||
cleanup('v2/xhr');
|
||||
await generateClient('v2/xhr', 'v2', 'xhr');
|
||||
copyAsset('index.html', 'v2/xhr/index.html');
|
||||
copyAsset('main.ts', 'v2/xhr/main.ts');
|
||||
compileWithTypescript('v2/xhr');
|
||||
await server.start('v2/xhr');
|
||||
await browser.start();
|
||||
|
||||
@ -1,17 +1,19 @@
|
||||
import browser from './scripts/browser';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { copy } from './scripts/copy';
|
||||
import { generate } from './scripts/generate';
|
||||
import { buildAngularProject } from './scripts/buildAngularProject';
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { copyAsset } from './scripts/copyAsset';
|
||||
import { createAngularProject } from './scripts/createAngularProject';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v3.angular', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v3/angular', 'v3', 'angular');
|
||||
await copy('index.html', 'v3/angular/index.html');
|
||||
await copy('script.js', 'v3/angular/script.js');
|
||||
await copy('main-angular.ts', 'v3/angular/main.ts');
|
||||
compileWithTypescript('v3/angular');
|
||||
await server.start('v3/angular');
|
||||
cleanup('v3/angular');
|
||||
createAngularProject('v3/angular', 'app');
|
||||
await generateClient('v3/angular/app/src', 'v3', 'angular');
|
||||
copyAsset('main-angular.ts', 'v3/angular/app/src/main.ts');
|
||||
buildAngularProject('v3/angular', 'app', 'dist');
|
||||
await server.start('v2/angular/dist');
|
||||
await browser.start();
|
||||
}, 30000);
|
||||
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { generate } from './scripts/generate';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v3.node', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v3/axios', 'v3', 'axios');
|
||||
cleanup('v3/axios');
|
||||
await generateClient('v3/axios', 'v3', 'axios');
|
||||
compileWithTypescript('v3/axios');
|
||||
await server.start('v3/axios');
|
||||
}, 30000);
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
import browser from './scripts/browser';
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithBabel } from './scripts/compileWithBabel';
|
||||
import { copy } from './scripts/copy';
|
||||
import { generate } from './scripts/generate';
|
||||
import { copyAsset } from './scripts/copyAsset';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v3.babel', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v3/babel', 'v3', 'fetch', true, true);
|
||||
await copy('index.html', 'v3/babel/index.html');
|
||||
await copy('main.ts', 'v3/babel/main.ts');
|
||||
cleanup('v3/babel');
|
||||
await generateClient('v3/babel', 'v3', 'fetch', true, true);
|
||||
copyAsset('index.html', 'v3/babel/index.html');
|
||||
copyAsset('main.ts', 'v3/babel/main.ts');
|
||||
compileWithBabel('v3/babel');
|
||||
await server.start('v3/babel');
|
||||
await browser.start();
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
import browser from './scripts/browser';
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { copy } from './scripts/copy';
|
||||
import { generate } from './scripts/generate';
|
||||
import { copyAsset } from './scripts/copyAsset';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v3.fetch', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v3/fetch', 'v3', 'fetch');
|
||||
await copy('index.html', 'v3/fetch/index.html');
|
||||
await copy('main.ts', 'v3/fetch/main.ts');
|
||||
cleanup('v3/fetch');
|
||||
await generateClient('v3/fetch', 'v3', 'fetch');
|
||||
copyAsset('index.html', 'v3/fetch/index.html');
|
||||
copyAsset('main.ts', 'v3/fetch/main.ts');
|
||||
compileWithTypescript('v3/fetch');
|
||||
await server.start('v3/fetch');
|
||||
await browser.start();
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { generate } from './scripts/generate';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v3.node', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v3/node', 'v3', 'node');
|
||||
cleanup('v3/node');
|
||||
await generateClient('v3/node', 'v3', 'node');
|
||||
compileWithTypescript('v3/node');
|
||||
await server.start('v3/node');
|
||||
}, 30000);
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
import browser from './scripts/browser';
|
||||
import { cleanup } from './scripts/cleanup';
|
||||
import { compileWithTypescript } from './scripts/compileWithTypescript';
|
||||
import { copy } from './scripts/copy';
|
||||
import { generate } from './scripts/generate';
|
||||
import { copyAsset } from './scripts/copyAsset';
|
||||
import { generateClient } from './scripts/generateClient';
|
||||
import server from './scripts/server';
|
||||
|
||||
describe('v3.xhr', () => {
|
||||
beforeAll(async () => {
|
||||
await generate('v3/xhr', 'v3', 'xhr');
|
||||
await copy('index.html', 'v3/xhr/index.html');
|
||||
await copy('main.ts', 'v3/xhr/main.ts');
|
||||
cleanup('v3/xhr');
|
||||
await generateClient('v3/xhr', 'v3', 'xhr');
|
||||
copyAsset('index.html', 'v3/xhr/index.html');
|
||||
copyAsset('main.ts', 'v3/xhr/main.ts');
|
||||
compileWithTypescript('v3/xhr');
|
||||
await server.start('v3/xhr');
|
||||
await browser.start();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user