diff --git a/examples/react-example/src/App.test.jsx b/examples/react-example/src/App.test.jsx index e22d91ccd..ee495b31e 100644 --- a/examples/react-example/src/App.test.jsx +++ b/examples/react-example/src/App.test.jsx @@ -1,6 +1,7 @@ import { render, screen } from '@testing-library/react' import App from './App' import React from "react"; +import { expect, test } from "vitest"; test('renders learn react link', () => { render() diff --git a/test/cbor.test.js b/test/cbor.test.js index 32b17b79d..1fb4b6bb0 100644 --- a/test/cbor.test.js +++ b/test/cbor.test.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from 'vitest'; var CBOR = require('cbor-js'); var cborTypedArrayTagger = require('../src/util/cborTypedArrayTags.js'); diff --git a/test/examples/check-topics.example.js b/test/examples/check-topics.example.js index 3da1f5b82..a84ccb8de 100644 --- a/test/examples/check-topics.example.js +++ b/test/examples/check-topics.example.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from "vitest"; var ROSLIB = require('../..'); var expectedTopics = [ diff --git a/test/examples/fibonacci.example.js b/test/examples/fibonacci.example.js index 74e9c42fa..2d2109d56 100644 --- a/test/examples/fibonacci.example.js +++ b/test/examples/fibonacci.example.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from "vitest"; var ROSLIB = require('../..'); describe('Fibonacci Example', function() { diff --git a/test/examples/params.examples.js b/test/examples/params.examples.js index 3ee4e7907..a150429af 100644 --- a/test/examples/params.examples.js +++ b/test/examples/params.examples.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from "vitest"; var ROSLIB = require('../..'); describe('Param setting', function() { diff --git a/test/examples/pubsub.example.js b/test/examples/pubsub.example.js index 7a9df67bf..35b806e68 100644 --- a/test/examples/pubsub.example.js +++ b/test/examples/pubsub.example.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect, afterAll } from 'vitest'; var ROSLIB = require('../..'); describe('Topics Example', function() { diff --git a/test/examples/tf.example.js b/test/examples/tf.example.js index b4dff7cce..9c6f0a88f 100644 --- a/test/examples/tf.example.js +++ b/test/examples/tf.example.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from "vitest"; var ROSLIB = require('../..'); describe('TF2 Republisher Example', function() { diff --git a/test/examples/tf_service.example.js b/test/examples/tf_service.example.js index e28cfd144..e5555fbd0 100644 --- a/test/examples/tf_service.example.js +++ b/test/examples/tf_service.example.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from "vitest"; var ROSLIB = require('../..'); describe('TF2 Republisher Service Example', function() { diff --git a/test/examples/topic-listener.example.js b/test/examples/topic-listener.example.js index 129f95f25..6d900008f 100644 --- a/test/examples/topic-listener.example.js +++ b/test/examples/topic-listener.example.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from 'vitest'; var ROSLIB = require('../..'); var ros = new ROSLIB.Ros({ diff --git a/test/math-examples.test.js b/test/math-examples.test.js index 2990c6ab7..639729648 100644 --- a/test/math-examples.test.js +++ b/test/math-examples.test.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from 'vitest'; var ROSLIB = require('..'); function clone(x) { diff --git a/test/quaternion.test.js b/test/quaternion.test.js index 2cd01a862..90f38e8f7 100644 --- a/test/quaternion.test.js +++ b/test/quaternion.test.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from "vitest"; var ROSLIB = require('..'); diff --git a/test/tfclient.test.js b/test/tfclient.test.js index 0da77750a..6456feff2 100644 --- a/test/tfclient.test.js +++ b/test/tfclient.test.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from "vitest"; var ROSLIB = require('..'); describe('TFClient', function() { diff --git a/test/transform.test.js b/test/transform.test.js index c6de2530e..ccb8b71d3 100644 --- a/test/transform.test.js +++ b/test/transform.test.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from "vitest"; var ROSLIB = require('..'); describe('Transform', function() { diff --git a/test/urdf.test.js b/test/urdf.test.js index 34990e7a4..e3657dba8 100644 --- a/test/urdf.test.js +++ b/test/urdf.test.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect; +import { describe, it, expect } from 'vitest'; var ROSLIB = require('..'); var DOMParser = require('@xmldom/xmldom').DOMParser; diff --git a/tsconfig.json b/tsconfig.json index 3e0915668..2d392db46 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,6 @@ "strict": true /* Enable all strict type-checking options. */, "noImplicitAny": false /* Enable error reporting for expressions and declarations with an implied 'any' type. */, "skipLibCheck": true, /* Skip type checking all .d.ts files. */ - "types": ["vitest/globals"] }, "include": ["src"] } diff --git a/vitest.config.js b/vitest.config.js index d8ba7a444..64e146e07 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -2,7 +2,6 @@ import {defineConfig} from "vitest/config"; export default defineConfig({ test: { - globals: true, include: [ // Default value for vitest; we just want to extend. '**\/*.{test,spec}.?(c|m)[jt]s?(x)',