Skip to content

Commit 6aebbf1

Browse files
committed
chore: switch back to nodejs 16, use imports in tests
1 parent 739b5d1 commit 6aebbf1

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
node-version: [18.x]
8+
node-version: [16.x]
99
steps:
1010
- uses: actions/checkout@v2
1111
- name: Use Node.js ${{ matrix.node-version }}

test/ast.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
import {ast} from './import';
12
import {AstEntity} from '../src';
2-
// eslint-disable-next-line @typescript-eslint/no-var-requires
3-
const {ast} = require('./import');
43

54
const lcFirst = (s: string) => s[0].toLowerCase() + s.slice(1);
65

test/import.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import * as Lib from '../src';
22

33
// eslint-disable-next-line @typescript-eslint/no-var-requires
4-
export = require(process.env.TEST_LIB ? '../lib' : '../src') as typeof Lib;
4+
const {ast, render, createParser} = require(process.env.TEST_LIB ? '../lib' : '../src') as typeof Lib;
5+
6+
export {ast, render, createParser};

test/parser.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// eslint-disable-next-line @typescript-eslint/no-var-requires
2-
const {createParser, ast} = require('./import');
1+
import {createParser, ast} from './import';
32

43
describe('parse()', () => {
54
const parse = createParser({

test/render.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// eslint-disable-next-line @typescript-eslint/no-var-requires
2-
const {createParser, render} = require('./import');
1+
import {createParser, render} from './import';
32

43
const testCases = {
54
'.class': '.class',

0 commit comments

Comments
 (0)