From 7937934d827afb07a03f30795e2062444a2e2cc6 Mon Sep 17 00:00:00 2001 From: Erik Moura Date: Sun, 13 Nov 2022 16:25:21 -0300 Subject: [PATCH] add possible test --- .../api/core/test/fast/forge-config_spec.ts | 7 +++++++ .../fixture/dummy_ts_conf/forge.config.yml | 1 + .../test/fixture/dummy_ts_conf/package.json | 20 +++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 packages/api/core/test/fixture/dummy_ts_conf/forge.config.yml create mode 100644 packages/api/core/test/fixture/dummy_ts_conf/package.json diff --git a/packages/api/core/test/fast/forge-config_spec.ts b/packages/api/core/test/fast/forge-config_spec.ts index e83791f5e7..c43b293a53 100644 --- a/packages/api/core/test/fast/forge-config_spec.ts +++ b/packages/api/core/test/fast/forge-config_spec.ts @@ -114,6 +114,13 @@ describe('forge-config', () => { expect(conf.defaultResolved).to.equal(true); }); + // @TODO make sure this test passes + it(`should resolve the yml config from forge.config.yml if it's specified in config.forge`, async () => { + type DefaultResolvedConfig = ResolvedForgeConfig; + const conf = (await findConfig(path.resolve(__dirname, '../fixture/dummy_ts_conf'))) as DefaultResolvedConfig; + expect(conf.buildIdentifier).to.equal('yml'); + }); + it('should resolve the TS file exports of forge.config.ts if config.forge does not exist and the TS config exists', async () => { type DefaultResolvedConfig = ResolvedForgeConfig; const conf = (await findConfig(path.resolve(__dirname, '../fixture/dummy_default_ts_conf'))) as DefaultResolvedConfig; diff --git a/packages/api/core/test/fixture/dummy_ts_conf/forge.config.yml b/packages/api/core/test/fixture/dummy_ts_conf/forge.config.yml new file mode 100644 index 0000000000..ee69896efa --- /dev/null +++ b/packages/api/core/test/fixture/dummy_ts_conf/forge.config.yml @@ -0,0 +1 @@ +buildIdentifier: 'yml' diff --git a/packages/api/core/test/fixture/dummy_ts_conf/package.json b/packages/api/core/test/fixture/dummy_ts_conf/package.json new file mode 100644 index 0000000000..df0eaf8be0 --- /dev/null +++ b/packages/api/core/test/fixture/dummy_ts_conf/package.json @@ -0,0 +1,20 @@ +{ + "name": "", + "productName": "", + "version": "1.0.0", + "description": "", + "main": "src/index.js", + "scripts": { + "start": "electron-forge start" + }, + "keywords": [], + "author": "", + "license": "MIT", + "config": { + "forge": "./forge.config.yml" + }, + "devDependencies": { + "@electron-forge/shared-types": "*", + "electron-prebuilt": "9.9.9" + } +}