Skip to content

Commit

Permalink
chore(js): remove failing snapshot from js unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Nov 29, 2023
1 parent 2c88282 commit 252f216
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,59 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`lib --bundler=vite should add build and test targets with vite and vitest 1`] = `
"/// <reference types='vitest' />
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import * as path from 'path';
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
export default defineConfig({
cacheDir: '../node_modules/.vite/my-lib',
plugins: [
nxViteTsPaths(),
dts({
entryRoot: 'src',
tsConfigFilePath: path.join(__dirname, 'tsconfig.lib.json'),
skipDiagnostics: true,
}),
],
// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },
// Configuration for building your library.
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
lib: {
// Could also be a dictionary or array of multiple entry points.
entry: 'src/index.ts',
name: 'my-lib',
fileName: 'index',
// Change this to the formats you want to support.
// Don't forget to update your package.json as well.
formats: ['es', 'cjs'],
},
rollupOptions: {
// External packages that should not be bundled into your library.
external: [],
},
},
test: {
globals: true,
cache: {
dir: '../node_modules/.vitest',
},
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
},
});
"
`;

exports[`lib --unit-test-runner jest should generate test configuration with swc and js 1`] = `
"/* eslint-disable */
const { readFileSync } = require('fs');
Expand Down
2 changes: 1 addition & 1 deletion packages/js/src/generators/library/library.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ describe('lib', () => {
expect(project.targets.test).toMatchObject({
executor: '@nx/vite:test',
});
expect(tree.read('my-lib/vite.config.ts', 'utf-8')).toMatchSnapshot();
expect(tree.exists('my-lib/vite.config.ts')).toBeTruthy();
expect(readJson(tree, 'my-lib/.eslintrc.json').overrides).toContainEqual({
files: ['*.json'],
parser: 'jsonc-eslint-parser',
Expand Down

0 comments on commit 252f216

Please sign in to comment.