Skip to content

Commit

Permalink
Yarn 101
Browse files Browse the repository at this point in the history
  • Loading branch information
BassemNKhalil committed Nov 16, 2023
1 parent d55debe commit 21ebd78
Show file tree
Hide file tree
Showing 6 changed files with 2,940 additions and 4,977 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [16, 18]
include:
- os: ubuntu-latest
npm_path: /home/runner/.npm/_logs/
- os: macos-latest
npm_path: /Users/runner/.npm/_logs/
- os: windows-latest
npm_path: C:\npm\cache\_logs

runs-on: ${{ matrix.os }}
continue-on-error: true
Expand All @@ -32,10 +25,5 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: npm config get cache
- run: npm cit
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: my-artifact-${{ matrix.os }}-${{ matrix.version }}
path: ${{ matrix.npm_path }}
- run: yarn install
- run: yarn test
15 changes: 2 additions & 13 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,15 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [16, 18]
include:
- os: ubuntu-latest
npm_path: /home/runner/.npm/_logs/
- os: macos-latest
npm_path: /Users/runner/.npm/_logs/
- os: windows-latest
npm_path: C:\npm\cache\_logs
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: npm cit
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: my-artifact-${{ matrix.os }}-${{ matrix.version }}
path: ${{ matrix.npm_path }}
- run: yarn install
- run: yarn test
coverage-report:
uses: ./.github/workflows/jest_coverage_report.yml
needs: run-tests
Expand Down
4 changes: 2 additions & 2 deletions Commands/fastServe.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const fastServeCommand = {

if (!existsSync(join(folderPath, "fast-serve", "config.json"))) {
process.chdir(folderPath);
chalk.Message("Running npx spfx-fast-serve");
execSync("npx --yes spfx-fast-serve");
chalk.Message("Running spfx-fast-serve");
execSync("spfx-fast-serve");
chalk.Success("spfx-fast-serve config completed");
} else {
chalk.Warning("spfx-fast-serve already configured");
Expand Down
4 changes: 2 additions & 2 deletions Commands/fastServe.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test("fastServe: needs to be installed globally & needs to be configured in proj

expect(existsSync).toHaveBeenCalled();
expect(chdir).toHaveBeenCalled();
expect(chalkMessage).toHaveBeenCalledWith("Running npx spfx-fast-serve");
expect(chalkMessage).toHaveBeenCalledWith("Running spfx-fast-serve");
expect(chalkSuccess).toHaveBeenCalledWith("spfx-fast-serve config completed");

expect(execSync).toHaveBeenCalledTimes(1);
Expand All @@ -52,7 +52,7 @@ test("fastServe: already installed globally but needs to be configured in projec

expect(existsSync).toHaveBeenCalled();
expect(chdir).toHaveBeenCalled();
expect(chalkMessage).toHaveBeenCalledWith("Running npx spfx-fast-serve");
expect(chalkMessage).toHaveBeenCalledWith("Running spfx-fast-serve");
expect(chalkSuccess).toHaveBeenCalledWith("spfx-fast-serve config completed");

expect(execSync).toHaveBeenCalledTimes(1);
Expand Down
Loading

0 comments on commit 21ebd78

Please sign in to comment.