|
| 1 | +import { AndroidPluginBuildService } from "../../lib/services/android-plugin-build-service"; |
| 2 | +import { Yok } from "../../lib/common/yok"; |
| 3 | +// import * as stubs from "../stubs"; |
| 4 | +import { assert } from "chai"; |
| 5 | +// import temp = require("temp"); |
| 6 | +import * as FsLib from "../../lib/common/file-system"; |
| 7 | +// import * as path from "path"; |
| 8 | +import { ChildProcess } from "../../lib/common/child-process"; |
| 9 | +import { HostInfo } from "../../lib/common/host-info"; |
| 10 | +import { AndroidToolsInfo } from "../../lib/android-tools-info"; |
| 11 | +import { Logger } from "../../lib/common/logger"; |
| 12 | +import * as ErrorsLib from "../../lib/common/errors"; |
| 13 | + |
| 14 | +describe('androiPluginBuildService', () => { |
| 15 | + |
| 16 | + const createTestInjector = (): IInjector => { |
| 17 | + const testInjector = new Yok(); |
| 18 | + |
| 19 | + testInjector.register("fs", FsLib.FileSystem); |
| 20 | + testInjector.register("childProcess", ChildProcess); |
| 21 | + testInjector.register("hostInfo", HostInfo); |
| 22 | + testInjector.register("androidToolsInfo", AndroidToolsInfo); |
| 23 | + testInjector.register("logger", Logger); |
| 24 | + testInjector.register("errors", ErrorsLib); |
| 25 | + testInjector.register("options", {}); |
| 26 | + testInjector.register("config", {}); |
| 27 | + testInjector.register("staticConfig", {}); |
| 28 | + |
| 29 | + return testInjector; |
| 30 | + }; |
| 31 | + |
| 32 | + let testInjector: IInjector; |
| 33 | + let fs: IFileSystem; |
| 34 | + let androidBuildPluginService: AndroidPluginBuildService; |
| 35 | + |
| 36 | + beforeEach(() => { |
| 37 | + testInjector = createTestInjector(); |
| 38 | + |
| 39 | + androidBuildPluginService = testInjector.resolve<AndroidPluginBuildService>(AndroidPluginBuildService); |
| 40 | + fs = testInjector.resolve("fs"); |
| 41 | + }); |
| 42 | + |
| 43 | + describe('builds aar', () => { |
| 44 | + |
| 45 | + it.only('if supported files are in plugin', () => { |
| 46 | + const config: IBuildOptions = { |
| 47 | + platformsAndroidDirPath: "string", |
| 48 | + pluginName: "string", |
| 49 | + aarOutputDir: "string", |
| 50 | + tempPluginDirPath: "string" |
| 51 | + }; |
| 52 | + androidBuildPluginService.buildAar(config); |
| 53 | + const expectedAarName = "my_plugin.aar"; |
| 54 | + assert.equal("asd", expectedAarName); |
| 55 | + }); |
| 56 | + }); |
| 57 | +}); |
0 commit comments