Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanqing committed Sep 21, 2024
1 parent 5dddc0e commit 6bb4f1b
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions packages/build/test/watch-async/watch-ignore-regex.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import test from 'ava'

import { watchIgnoreRegex } from '../../src/watch-async/create-watch-ignore-regex.js'
import { createWatchIgnoreRegex } from '../../src/watch-async/create-watch-ignore-regex.js'

test('ignored', function (t) {
t.plan(6)
t.true(watchIgnoreRegex.test('node_modules'))
t.true(watchIgnoreRegex.test('manifest.json'))
t.true(watchIgnoreRegex.test('package-lock.json'))
t.true(watchIgnoreRegex.test('styles.css.d.ts'))
t.true(watchIgnoreRegex.test('src/styles.css.d.ts'))
t.true(watchIgnoreRegex.test('build/main.js'))
t.true(createWatchIgnoreRegex('./').test('node_modules'))
t.true(createWatchIgnoreRegex('./').test('manifest.json'))
t.true(createWatchIgnoreRegex('./').test('package-lock.json'))
t.true(createWatchIgnoreRegex('./').test('styles.css.d.ts'))
t.true(createWatchIgnoreRegex('./').test('src/styles.css.d.ts'))
t.true(createWatchIgnoreRegex('./').test('build/main.js'))
})

test('not ignored', function (t) {
t.plan(9)
t.false(watchIgnoreRegex.test('build-figma-plugin.manifest.js'))
t.false(watchIgnoreRegex.test('build-figma-plugin.main.js'))
t.false(watchIgnoreRegex.test('build-figma-plugin.ui.js'))
t.false(watchIgnoreRegex.test('package.json'))
t.false(watchIgnoreRegex.test('tsconfig.json'))
t.false(watchIgnoreRegex.test('src/data.json'))
t.false(watchIgnoreRegex.test('src/main.js'))
t.false(watchIgnoreRegex.test('src/styles.css'))
t.false(watchIgnoreRegex.test('src/ui.tsx'))
t.false(createWatchIgnoreRegex('./').test('build-figma-plugin.manifest.js'))
t.false(createWatchIgnoreRegex('./').test('build-figma-plugin.main.js'))
t.false(createWatchIgnoreRegex('./').test('build-figma-plugin.ui.js'))
t.false(createWatchIgnoreRegex('./').test('package.json'))
t.false(createWatchIgnoreRegex('./').test('tsconfig.json'))
t.false(createWatchIgnoreRegex('./').test('src/data.json'))
t.false(createWatchIgnoreRegex('./').test('src/main.js'))
t.false(createWatchIgnoreRegex('./').test('src/styles.css'))
t.false(createWatchIgnoreRegex('./').test('src/ui.tsx'))
})

0 comments on commit 6bb4f1b

Please sign in to comment.