Debian Codegraph @

tests/unit/swup.test.ts

raw
1 import { describe, expect, it } from 'vitest';
2
3 import pckg from '../../package.json';
4 import Swup, { Location } from '../../src/index.js';
5 import { Cache } from '../../src/modules/Cache.js';
6 import { Hooks } from '../../src/modules/Hooks.js';
7
8 describe('Swup', () => {
9 it('should have a version', () => {
10 const swup = new Swup();
11 expect(swup.version).not.toBeUndefined();
12 expect(swup.version).toEqual(pckg.version);
13 });
14
15 it('should have a cache instance', () => {
16 const swup = new Swup();
17 expect(swup.cache).toBeInstanceOf(Cache);
18 });
19
20 it('should have a hooks instance', () => {
21 const swup = new Swup();
22 expect(swup.hooks).toBeInstanceOf(Hooks);
23 });
24
25 it('should have a location', () => {
26 const swup = new Swup();
27 expect(swup.location).toBeInstanceOf(Location);
28 });
29 });