Skip to content

Commit

Permalink
style: embrace chaos 🙈
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Aug 3, 2022
1 parent 5ff9a61 commit be0a93a
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions test/exports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,42 +50,42 @@ describe('findExports', () => {

it('works with multiple named exports', () => {
const code = `
export { foo } from 'foo1';
export { bar } from 'foo2';
export { foobar } from 'foo2';
`
export { foo } from 'foo1';
export { bar } from 'foo2';
export { foobar } from 'foo2';
`
const matches = findExports(code)
expect(matches).to.have.lengthOf(3)
})

// TODO: https://github.com/unjs/mlly/issues/64
it.todo('the commented out export should be filtered out', () => {
const code = `
// export { foo } from 'foo1';
// exports default 'foo';
// export { useB, _useC as useC };
// export function useA () { return 'a' }
// export { default } from "./other"
// export async function foo () {}
// export { foo as default }
//export * from "./other"
//export * as foo from "./other"
// export { foo } from 'foo1';
// exports default 'foo';
// export { useB, _useC as useC };
// export function useA () { return 'a' }
// export { default } from "./other"
// export async function foo () {}
// export { foo as default }
//export * from "./other"
//export * as foo from "./other"
/**
* export const a = 123
* export { foo } from 'foo1';
* exports default 'foo'
* export function useA () { return 'a' }
* export { useB, _useC as useC };
*export { default } from "./other"
*export async function foo () {}
* export { foo as default }
* export * from "./other"
export * as foo from "./other"
*/
export { bar } from 'foo2';
export { foobar } from 'foo2';
`
/**
* export const a = 123
* export { foo } from 'foo1';
* exports default 'foo'
* export function useA () { return 'a' }
* export { useB, _useC as useC };
*export { default } from "./other"
*export async function foo () {}
* export { foo as default }
* export * from "./other"
export * as foo from "./other"
*/
export { bar } from 'foo2';
export { foobar } from 'foo2';
`
const matches = findExports(code)
expect(matches).to.have.lengthOf(2)
})
Expand Down Expand Up @@ -123,9 +123,9 @@ describe('findExports', () => {
describe('fineExportNames', () => {
it('findExportNames', () => {
expect(findExportNames(`
export const foo = 'bar'
export { bar, baz }
export default something
export const foo = 'bar'
export { bar, baz }
export default something
`)).toMatchInlineSnapshot(`
[
"foo",
Expand Down

0 comments on commit be0a93a

Please sign in to comment.