Skip to content

Commit

Permalink
issue-#98,#97 - Updated 'ts-node' and 'typescript' versions.
Browse files Browse the repository at this point in the history
- Added '@ava/typescript' module to package (required by latest version of AVA).
- Updated tests to follow new syntax for 'after', and 'before, methods.
  • Loading branch information
elycruz committed Jul 20, 2022
1 parent 198c1d3 commit 82dc1c8
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 39 deletions.
172 changes: 140 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -52,6 +52,7 @@
"sass": "^1.7.2"
},
"devDependencies": {
"@ava/typescript": "^3.0.1",
"@types/node": "^15.14.9",
"@types/resolve": "^0.0.8",
"@types/rollup": "^0.54.0",
Expand All @@ -63,8 +64,8 @@
"nyc": "^15.1.0",
"rollup": "^1.32.1",
"sinon": "^7.2.2",
"ts-node": "^10.2.0",
"typescript": "3.5.3"
"ts-node": "^10.9.1",
"typescript": "^4.7.4"
},
"engines": {
"node": ">=10"
Expand Down
6 changes: 3 additions & 3 deletions test/index.test.ts
@@ -1,6 +1,6 @@
import {promises as fs, constants as fsConstants} from 'fs';
import * as path from 'path';
import test, {after, before} from 'ava';
import test from 'ava';
import sinon from 'sinon';
import {OutputOptions, rollup, RollupOutput} from 'rollup';
import * as sassJs from 'sass';
Expand Down Expand Up @@ -41,7 +41,7 @@ const repoRoot = path.join(__dirname, '../'),

let expectA, expectB, expectC, expectD, expectE;

before(async () => {
test.before(async () => {
const mkDir = () => fs.mkdir(tmpDir);

await fs.rmdir(tmpDir, {recursive: true})
Expand Down Expand Up @@ -445,7 +445,7 @@ test('When `sourcemap` is set, to `true`, adjacent source map file should be out
});
});

after(async (): Promise<any> => {
test.after(async (): Promise<any> => {
return fs.rmdir(tmpDir, {recursive: true})
.catch(error);
});
4 changes: 2 additions & 2 deletions test/style.test.ts
@@ -1,12 +1,12 @@
import test, {before} from 'ava';
import test from 'ava';
import {readFileSync} from 'fs';
import {insertStyle} from '../src/style';
import jsdom from 'jsdom';

const expectA = readFileSync('test/assets/expect_a.css').toString();
const newLineRegex = /[\n\r\f\t]+/g;

before(async () => {
test.before(async () => {
const dom = new jsdom.JSDOM(`<!Doctype html>
<html>
<head></head>
Expand Down

0 comments on commit 82dc1c8

Please sign in to comment.