Skip to content

Commit

Permalink
chore(#63): add integration tests for android & ios commands (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz1913 authored Jan 8, 2024
1 parent 1aaf7fe commit f19bce3
Show file tree
Hide file tree
Showing 19 changed files with 4,652 additions and 4,230 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ jobs:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install modules
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: "**/yarn.lock"
- run: yarn
- name: Code Quality
run: yarn lint
- name: Unit Tests
run: yarn test
- run: yarn build:prod
3 changes: 1 addition & 2 deletions .github/workflows/npm-release-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ jobs:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install modules
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: "**/yarn.lock"
Expand Down
9 changes: 9 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-after-install.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-disable */
//prettier-ignore
module.exports = {
name: "@yarnpkg/plugin-after-install",
factory: function (require) {
"use strict";var plugin=(()=>{var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var r=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(o,e)=>(typeof require<"u"?require:o)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var I=(t,o)=>{for(var e in o)s(t,e,{get:o[e],enumerable:!0})},h=(t,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of x(o))!C.call(t,n)&&n!==e&&s(t,n,{get:()=>o[n],enumerable:!(a=g(o,n))||a.enumerable});return t};var k=t=>h(s({},"__esModule",{value:!0}),t);var P={};I(P,{default:()=>y});var d=r("@yarnpkg/core");var f=r("@yarnpkg/core"),c={afterInstall:{description:"Hook that will always run after install",type:f.SettingsType.STRING,default:""}};var p=r("clipanion"),u=r("@yarnpkg/core");var m=r("@yarnpkg/shell"),l=async(t,o)=>{let e=t.get("afterInstall"),a=!!t.projectCwd?.endsWith(`dlx-${process.pid}`);return e&&!a?(o&&console.log("Running `afterInstall` hook..."),(0,m.execute)(e,[],{cwd:t.projectCwd||void 0})):0};var i=class extends p.Command{async execute(){let o=await u.Configuration.find(this.context.cwd,this.context.plugins);return l(o,!1)}};i.paths=[["after-install"]];var w={configuration:c,commands:[i],hooks:{afterAllInstalled:async(t,o)=>{if(o?.mode===d.InstallMode.UpdateLockfile)return;if(await l(t.configuration,!0))throw new Error("The `afterInstall` hook failed, see output above.")}}},y=w;return k(P);})();
return plugin;
}
};
8 changes: 0 additions & 8 deletions .yarn/plugins/@yarnpkg/plugin-postinstall.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.3.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
compressionLevel: mixed

enableGlobalCache: true

enableTelemetry: false
Expand All @@ -15,9 +17,8 @@ logFilters:
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-postinstall.cjs
spec: "https://raw.githubusercontent.com/gravitywelluk/yarn-plugin-postinstall/master/bundles/%40yarnpkg/plugin-postinstall.js"

postinstall: chmod +x node_modules/@evilmartians/lefthook/bin/index.js && npx -c 'lefthook install'
- checksum: 0a2a35fbed2f33f0df1ceb1db51bf72554201f994eaecb86cbc62a295c3d05f7cc44fa8be8e64fc5e1c0bee4f529a17a0cc429ea9e3486ad467443291d5a8e3b
path: .yarn/plugins/@yarnpkg/plugin-after-install.cjs
spec: "https://raw.githubusercontent.com/mhassan1/yarn-plugin-after-install/v0.6.0/bundles/@yarnpkg/plugin-after-install.js"

yarnPath: .yarn/releases/yarn-3.6.3.cjs
yarnPath: .yarn/releases/yarn-4.0.2.cjs
3 changes: 3 additions & 0 deletions __mocks__/fs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { fs } = require('memfs');

module.exports = fs;
3 changes: 3 additions & 0 deletions __mocks__/fs/promises.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { fs } = require('memfs');

module.exports = fs.promises;
66 changes: 66 additions & 0 deletions __mocks__/ora.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
class MockedOra {
color = 'cyan';
indent = 2;
interval = 100;
spinner = require('cli-spinners').clock;
text = 'xyz';
prefixText = 'abc';
suffixText = '123';
isSpinning = false;
isEnabled = true;
isSilent = false;

frame() {
return 'frame';
}

clear() {
return this;
}

render() {
return this;
}

start() {
return this;
}

stop() {
return this;
}

succeed() {
return this;
}

fail() {
return this;
}

warn() {
return this;
}

info() {
return this;
}

stopAndPersist() {
return this;
}
}

function mockOra() {
return new MockedOra();
}

module.exports = mockOra;
module.exports.oraPromise = jest.fn().mockImplementation((action) => {
if (typeof action === 'function') {
return action(mockOra());
}

return action;
});
module.exports.spinners = require('cli-spinners');
5 changes: 5 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ commit-msg:
commands:
commitlint:
run: npx commitlint --edit
pre-push:
parallel: true
commands:
test:
run: yarn test
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,28 @@
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@commitlint/config-conventional": "17.7.0",
"@evilmartians/lefthook": "1.5.0",
"@release-it/conventional-changelog": "7.0.0",
"@commitlint/config-conventional": "18.4.4",
"@evilmartians/lefthook": "1.5.5",
"@release-it/conventional-changelog": "8.0.1",
"@types/glob": "8.1.0",
"@types/mock-fs": "^4.13.2",
"@types/prompts": "2.4.5",
"@types/yargs": "17.0.25",
"@typescript-eslint/eslint-plugin": "6.7.3",
"@typescript-eslint/parser": "6.7.3",
"@vercel/ncc": "0.38.0",
"commitlint": "17.7.1",
"eslint": "8.50.0",
"eslint-plugin-import": "2.28.1",
"jest": "^29.7.0",
"@types/jest": "29.5.11",
"@types/prompts": "2.4.9",
"@types/yargs": "17.0.32",
"@typescript-eslint/eslint-plugin": "6.18.1",
"@typescript-eslint/parser": "6.18.1",
"@vercel/ncc": "0.38.1",
"commitlint": "18.4.4",
"eslint": "8.56.0",
"eslint-plugin-import": "2.29.1",
"jest": "29.7.0",
"kleur": "4.1.5",
"mock-fs": "^5.2.0",
"ora": "7.0.1",
"memfs": "4.6.0",
"ora": "8.0.1",
"prompts": "2.4.2",
"release-it": "16.1.5",
"ts-jest": "^29.1.1",
"typescript": "5.2.2",
"release-it": "17.0.1",
"ts-jest": "29.1.1",
"ts-node": "10.9.2",
"typescript": "5.3.3",
"xcode": "3.0.1",
"yargs": "17.7.2"
},
Expand Down Expand Up @@ -88,5 +89,5 @@
}
}
},
"packageManager": "yarn@3.6.3"
"packageManager": "yarn@4.0.2"
}
Loading

0 comments on commit f19bce3

Please sign in to comment.