Skip to content

Commit 8a67fa6

Browse files
committed
change yarn to npm
1 parent 4b01b66 commit 8a67fa6

File tree

5 files changed

+49
-52
lines changed

5 files changed

+49
-52
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ env:
44
SCRIPT_DIR: ./.github/scripts
55

66
jobs:
7-
# test:
8-
# strategy:
9-
# matrix:
10-
# os: [macos-latest, ubuntu-latest, windows-latest]
11-
# runs-on: ${{ matrix.os }}
12-
# steps:
13-
# - uses: actions/checkout@v3
14-
# - uses: actions/setup-node@v3
15-
# with:
16-
# node-version: 18
17-
# - run: yarn install
18-
# - name: Run tests
19-
# uses: GabrielBB/xvfb-action@v1.0
20-
# with:
21-
# run: npm run test
7+
test:
8+
strategy:
9+
matrix:
10+
os: [macos-latest, ubuntu-latest, windows-latest]
11+
runs-on: ${{ matrix.os }}
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 18
17+
- run: npm install
18+
- name: Run tests
19+
uses: GabrielBB/xvfb-action@v1.0
20+
with:
21+
run: npm run test
2222
build:
2323
runs-on: ubuntu-latest
2424
env:
2525
VSIX_FILE: vscode-R.vsix
2626
steps:
2727
- uses: actions/checkout@v3
2828
- run: node $SCRIPT_DIR/enableWebpack.js
29-
- run: yarn install
29+
- run: npm install
3030
- uses: lannonbr/vsce-action@4.0.0
3131
with:
3232
args: "package -o $VSIX_FILE"
@@ -41,8 +41,8 @@ jobs:
4141
- uses: actions/setup-node@v3
4242
with:
4343
node-version: 18
44-
- run: yarn install
45-
- run: yarn run lint
44+
- run: npm install
45+
- run: npm run lint
4646
markdownlint-cli:
4747
runs-on: ubuntu-latest
4848
steps:
@@ -79,6 +79,6 @@ jobs:
7979
- uses: actions/setup-node@v3
8080
with:
8181
node-version: 18
82-
- run: yarn install
82+
- run: npm install
8383
- name: Run devreplay
8484
run: ./node_modules/.bin/devreplay ./src devreplay.json

.github/workflows/pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v3
1818
- run: node $SCRIPT_DIR/enableWebpack.js
19-
- run: yarn install
19+
- run: npm install
2020
- uses: lannonbr/vsce-action@4.0.0
2121
with:
2222
args: "package -o $FILE_OUT"

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v3
1818
- run: node $SCRIPT_DIR/enableWebpack.js
19-
- run: yarn install
19+
- run: npm install
2020
- uses: lannonbr/vsce-action@4.0.0
2121
with:
2222
args: "package"
@@ -57,7 +57,7 @@ jobs:
5757
steps:
5858
- uses: actions/checkout@v3
5959
- run: node $SCRIPT_DIR/enableWebpack.js
60-
- run: yarn install
60+
- run: npm install
6161
- name: Publish to Open VSX Registry
6262
uses: HaaLeo/publish-vscode-extension@v1
6363
id: publishToOpenVSX

.vscode/tasks.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"command": "vsce",
1111
"args": [
1212
"package",
13-
"--yarn",
1413
"-o",
1514
"${workspaceFolderBasename}.vsix"
1615
]

src/test/suite/index.ts

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,38 @@
44

55
import * as path from 'path';
66
import * as Mocha from 'mocha';
7-
// @ts-ignore: all
87
import { glob } from 'glob';
98

109
export function run(): Promise<void> {
11-
// Create the mocha test
12-
const mocha = new Mocha({
13-
ui: 'tdd',
14-
color: true
15-
});
10+
// Create the mocha test
11+
const mocha = new Mocha({
12+
ui: 'tdd',
13+
color: true
14+
});
1615

17-
const testsRoot = path.resolve(__dirname, '..');
16+
const testsRoot = path.resolve(__dirname, '..');
1817

19-
return new Promise((c, e) => {
20-
// @ts-ignore: all
21-
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
22-
if (err) {
23-
return e(err);
24-
}
25-
26-
// Add files to the test suite
27-
files.forEach((f: string) => mocha.addFile(path.resolve(testsRoot, f)));
18+
return new Promise((c, e) => {
19+
glob('**/**.test.js', { cwd: testsRoot })
20+
.then(files => {
21+
// Add files to the test suite
22+
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
2823

29-
try {
30-
// Run the mocha test
31-
mocha.run(failures => {
32-
if (failures > 0) {
33-
e(new Error(`${failures} tests failed.`));
34-
} else {
35-
c();
36-
}
37-
});
38-
} catch (err) {
39-
e(err);
24+
try {
25+
// Run the mocha test
26+
mocha.run(failures => {
27+
if (failures > 0) {
28+
e(new Error(`${failures} tests failed.`));
29+
} else {
30+
c();
4031
}
41-
});
42-
});
32+
});
33+
} catch (err) {
34+
e(err);
35+
}
36+
})
37+
.catch(err => {
38+
return e(err);
39+
});
40+
});
4341
}

0 commit comments

Comments
 (0)