nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: intlify/vue-i18n-next
Pull request #1849 (2024-05-11 08:59:14)

fix: allow empty default message

cloudflare-pages[bot]: ## Deploying vue-i18n-next with &nbsp;<a href="https://pages.dev"><img alt="Cloudflare Pages" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png" width="16"></a> &nbsp;Cloudflare Pages

<table><tr><td><strong>Latest commit:</strong> </td><td>
<code>2c2e8b2</code>
</td></tr>
<tr><td><strong>Status:</strong></td><td>&nbsp;✅&nbsp; Deploy successful!</td></tr>
<tr><td><strong>Preview URL:</strong></td><td>
<a href='https://f0d08b4a.vue-i18n-next.pages.dev'>https://f0d08b4a.vue-i18n-next.pages.dev</a>
</td></tr>
<tr><td><strong>Branch Preview URL:</strong></td><td>
<a href='https://fix-default-msg-allow-empty.vue-i18n-next.pages.dev'>https://fix-default-msg-allow-empty.vue-i18n-next.pages.dev</a>
</td></tr>
</table>

[View logs](https://dash.cloudflare.com/?to=/:account/pages/view/vue-i18n-next/f0d08b4a-c1d3-4522-ac32-12524bf79c66)


Patch:
diff --git a/packages/core-base/src/translate.ts b/packages/core-base/src/translate.ts
index e1586036..da814870 100644
--- a/packages/core-base/src/translate.ts
+++ b/packages/core-base/src/translate.ts
@@ -649,8 +649,11 @@ export function translate<
         : (!messageCompiler ? () => key : key)
       : fallbackFormat // default by `fallbackFormat` option
         ? (!messageCompiler ? () => key : key)
-        : ''
-  const enableDefaultMsg = fallbackFormat || defaultMsgOrKey !== ''
+        : null
+  const enableDefaultMsg =
+    fallbackFormat ||
+    (defaultMsgOrKey != null &&
+      (isString(defaultMsgOrKey) || isFunction(defaultMsgOrKey)))
   const locale = getLocale(context, options)
 
   // escape params


Test patch:
diff --git a/packages/core-base/test/translate.test.ts b/packages/core-base/test/translate.test.ts
index 45940192..222032d9 100644
--- a/packages/core-base/test/translate.test.ts
+++ b/packages/core-base/test/translate.test.ts
@@ -120,6 +120,7 @@ describe('default option', () => {
     expect(translate(ctx, 'hello', 'hello, default message!')).toEqual(
       'hello, default message!'
     )
+    expect(translate(ctx, 'hello', '')).toEqual('')
   })
 
   test('boolean true', () => {
diff --git a/packages/vue-i18n-core/test/composer.test.ts b/packages/vue-i18n-core/test/composer.test.ts
index ae3902b7..7b31bb91 100644
--- a/packages/vue-i18n-core/test/composer.test.ts
+++ b/packages/vue-i18n-core/test/composer.test.ts
@@ -734,6 +734,16 @@ describe('t', () => {
     await nextTick()
     expect(t('hello')).toEqual(JA_HELLO)
   })
+
+  test('default msg', () => {
+    const { t } = createComposer({
+      locale: 'en',
+      messages: {
+        en: { hello: 'Hello!' }
+      }
+    })
+    expect(t('foo', '')).toEqual('')
+  })
 })
 
 describe('rt', () => {
Repository: intuit/auto
Pull request #548 (2019-09-02 23:01:54)

label creation is case insensitive
# What Changed

When deciding to update or create a label during `create-labels` make all current labels lowercase since label creation is case insensitive

# Why

Previously would error if you tried to create a lowercase version of a label

Todo:

- [ ] Add tests
- [ ] Add docs
- [ ] Add yourself to contributors (run `yarn contributors:add`)

<!-- GITHUB_RELEASE PR BODY: canary-version -->
Published PR with canary version: `7.4.2-canary.548.7126.0`
<!-- GITHUB_RELEASE PR BODY: canary-version -->



Patch:
diff --git a/packages/core/src/release.ts b/packages/core/src/release.ts
index 2d71b402..3ff5d6f9 100644
--- a/packages/core/src/release.ts
+++ b/packages/core/src/release.ts
@@ -462,7 +462,9 @@ export default class Release {
     labels: Partial<ILabelDefinitionMap>,
     options: ICreateLabelsOptions = {}
   ) {
-    const oldLabels = (await this.git.getProjectLabels()) || [];
+    const oldLabels = ((await this.git.getProjectLabels()) || []).map(l =>
+      l.toLowerCase()
+    );
     const labelsToCreate = Object.entries(labels).filter(
       ([versionLabel, labelDef]) => {
         if (!labelDef) {
@@ -496,7 +498,7 @@ export default class Release {
 
           return Promise.all(
             labelDefs.map(async labelDef => {
-              if (oldLabels.some(o => labelDef.name === o)) {
+              if (oldLabels.some(o => labelDef.name.toLowerCase() === o)) {
                 return this.git.updateLabel(label, labelDef);
               }
 


Test patch:
diff --git a/packages/core/src/__tests__/release.test.ts b/packages/core/src/__tests__/release.test.ts
index 16fc437f..f55730c0 100644
--- a/packages/core/src/__tests__/release.test.ts
+++ b/packages/core/src/__tests__/release.test.ts
@@ -969,6 +969,26 @@ describe('Release', () => {
       });
     });
 
+    test('should not add old labels - case sensitive', async () => {
+      const gh = new Release(git);
+      const labels = {
+        [SEMVER.major]: [{ name: 'major', description: '' }],
+        [SEMVER.minor]: [{ name: 'Minor', description: '' }]
+      };
+
+      getProjectLabels.mockReturnValueOnce(['Major', 'minor']);
+      await gh.addLabelsToProject(labels);
+
+      expect(updateLabel).toHaveBeenCalledWith(SEMVER.major, {
+        name: 'major',
+        description: ''
+      });
+      expect(updateLabel).toHaveBeenCalledWith(SEMVER.minor, {
+        description: '',
+        name: 'Minor'
+      });
+    });
+
     test('should add release label in onlyPublishWithReleaseLabel mode', async () => {
       let gh = new Release(git, {
         skipReleaseLabels: [],
Repository: intuit/auto
Pull request #609 (2019-10-17 16:57:50)

only add hash to canary version if no pr or build detected
# What Changed

We were adding the commit sha to canaries when we didn't need to

# Why

Shorter canary version are easier to consume

Todo:

- [x] Add tests

<!-- GITHUB_RELEASE PR BODY: canary-version -->
Published PR with canary version: `7.9.1-canary.609.7851.0`
<!-- GITHUB_RELEASE PR BODY: canary-version -->



Patch:
diff --git a/packages/core/src/auto.ts b/packages/core/src/auto.ts
index b6162223..3e9ea63c 100644
--- a/packages/core/src/auto.ts
+++ b/packages/core/src/auto.ts
@@ -560,7 +560,7 @@ export default class Auto {
       canaryVersion = `${canaryVersion}.${build}`;
     }
 
-    if (!('isPr' in env) || !build) {
+    if (!pr || !build) {
       canaryVersion = `${canaryVersion}.${await this.git.getSha(true)}`;
     }
 


Test patch:
diff --git a/packages/core/src/__tests__/auto.test.ts b/packages/core/src/__tests__/auto.test.ts
index a66ffbb8..fb9d36c6 100644
--- a/packages/core/src/__tests__/auto.test.ts
+++ b/packages/core/src/__tests__/auto.test.ts
@@ -937,7 +937,7 @@ describe('Auto', () => {
       jest.spyOn(auto.release!, 'getCommits').mockImplementation();
 
       await auto.canary({ pr: 123, build: 1 });
-      expect(canary).toHaveBeenCalledWith(SEMVER.patch, '.123.1.abc');
+      expect(canary).toHaveBeenCalledWith(SEMVER.patch, '.123.1');
       expect(auto.git!.addToPrBody).toHaveBeenCalled();
     });
Repository: intuit/auto
Pull request #638 (2019-10-29 06:02:55)

Update released plugin message creation to replace all tokens
# What Changed
- Updates `released` plugin's `createdReleasedComment` function to replace all instances of `%VERSION` and replace all instances of `%TYPE` instead of just the first instances

# Why
- In the use case a user wants to comment on pr with release version and link to the github release, the comment would look something like: 

  ```
  [%VERSION](https://github.com/intuit/auto/releases/tag/%VERSION)
  ```
  
  where if `%VERSION` needs to replaced multiple times by `v1.0.0`, then it should resolve to 

  ```
  [v1.0.0](https://github.com/intuit/auto/releases/tag/v1.0.0)
  ```

- Existing code only replaces the first instance giving

  ```
  [v1.0.0](https://github.com/intuit/auto/releases/tag/%VERSION)
  ```

# Todo:
- [x] Add tests

<!-- GITHUB_RELEASE PR BODY: canary-version -->
Published PR with canary version: `7.12.4-canary.638.8272.0`
<!-- GITHUB_RELEASE PR BODY: canary-version -->



Patch:
diff --git a/plugins/released/src/index.ts b/plugins/released/src/index.ts
index 9f396868..20ed228c 100644
--- a/plugins/released/src/index.ts
+++ b/plugins/released/src/index.ts
@@ -147,7 +147,7 @@ export default class ReleasedLabelPlugin implements IPlugin {
 
   private createReleasedComment(isIssue: boolean, version: string) {
     return this.options.message
-      .replace(TYPE, isIssue ? 'Issue' : 'PR')
-      .replace(VERSION, version);
+      .replace(new RegExp(TYPE, 'g'), isIssue ? 'Issue' : 'PR')
+      .replace(new RegExp(VERSION, 'g'), version);
   }
 }


Test patch:
diff --git a/plugins/released/__tests__/released-label.test.ts b/plugins/released/__tests__/released-label.test.ts
index 42c34ae4..b406c24e 100644
--- a/plugins/released/__tests__/released-label.test.ts
+++ b/plugins/released/__tests__/released-label.test.ts
@@ -205,6 +205,37 @@ describe('release label plugin', () => {
     );
   });
 
+  test('should comment and label PRs with custom message', async () => {
+    const releasedLabel = new ReleasedLabelPlugin({
+      message:
+        ':rocket: %TYPE is fixed. %TYPE was released in [%VERSION](https://github.com/intuit/auto/releases/tag/%VERSION) :rocket:'
+    });
+    const autoHooks = makeHooks();
+    releasedLabel.apply(({
+      hooks: autoHooks,
+      labels: defaultLabelDefinition,
+      logger: dummyLog(),
+      options: {},
+      comment,
+      git
+    } as unknown) as Auto);
+
+    const commit = makeCommitFromMsg('normal commit with no bump (#123)');
+    await autoHooks.afterRelease.promise({
+      newVersion: '1.0.0',
+      lastRelease: '0.1.0',
+      commits: await log.normalizeCommits([commit]),
+      releaseNotes: ''
+    });
+
+    expect(comment).toHaveBeenCalledWith(
+      expect.objectContaining({
+        message:
+          ':rocket: PR is fixed. PR was released in [1.0.0](https://github.com/intuit/auto/releases/tag/1.0.0) :rocket:'
+      })
+    );
+  });
+
   test('should do nothing with dryRun flag', async () => {
     const releasedLabel = new ReleasedLabelPlugin();
     const autoHooks = makeHooks();
Repository: intuit/auto
Pull request #659 (2019-11-07 18:23:10)

Fix creating old changelogs
# What Changed

fix bug where we couldn't reproduce old changelogs. 

ex: 

```sh
yarn auto changelog --from v0.107.0 -d
```

# Why

for the changelog to generate correctly you need all of the merge commits (they were getting omitted). If you tried to create a changelog after the pr was released it would contain all sub commits.

Todo:

- [x] Add tests


<!-- GITHUB_RELEASE PR BODY: canary-version -->
Published PR with canary version: `7.12.7-canary.659.8524.0`
<!-- GITHUB_RELEASE PR BODY: canary-version -->



Patch:
diff --git a/plugins/released/src/index.ts b/plugins/released/src/index.ts
index 20ed228c..10f42453 100644
--- a/plugins/released/src/index.ts
+++ b/plugins/released/src/index.ts
@@ -38,14 +38,6 @@ export default class ReleasedLabelPlugin implements IPlugin {
       return config;
     });
 
-    auto.hooks.onCreateLogParse.tap(this.name, logParse => {
-      logParse.hooks.omitCommit.tapPromise(this.name, async commit => {
-        if (commit.labels.includes(this.options.label)) {
-          return true;
-        }
-      });
-    });
-
     auto.hooks.afterRelease.tapPromise(
       this.name,
       async ({ newVersion, commits }) => {


Test patch:
diff --git a/plugins/released/__tests__/released-label.test.ts b/plugins/released/__tests__/released-label.test.ts
index b406c24e..31c34fdc 100644
--- a/plugins/released/__tests__/released-label.test.ts
+++ b/plugins/released/__tests__/released-label.test.ts
@@ -59,7 +59,7 @@ describe('release label plugin', () => {
     });
   });
 
-  test('should omit released PRs', async () => {
+  test('should not omit released PRs', async () => {
     const releasedLabel = new ReleasedLabelPlugin();
     const autoHooks = makeHooks();
     const logParseHooks = makeLogParseHooks();
@@ -75,12 +75,12 @@ describe('release label plugin', () => {
     autoHooks.onCreateLogParse.call({ hooks: logParseHooks } as LogParse);
 
     const included = makeCommitFromMsg('normal commit with no bump');
-    expect(await logParseHooks.omitCommit.promise(included)).toBeUndefined();
+    expect(await logParseHooks.omitCommit.promise(included)).not.toBe(true);
 
     const omitted = makeCommitFromMsg('normal commit with no bump', {
       labels: ['released']
     });
-    expect(await logParseHooks.omitCommit.promise(omitted)).toBe(true);
+    expect(await logParseHooks.omitCommit.promise(omitted)).not.toBe(true);
   });
 
   test('should do nothing without PRs', async () => {
Repository: fabien0102/ts-to-zod
Pull request #92 (2022-08-26 14:28:02)

fix: Fix nullable
# Why

Some nullable were not correctly generated

# Issue

#86


Patch:
diff --git a/src/core/generateZodSchema.ts b/src/core/generateZodSchema.ts
index 83dce7e..b917da9 100644
--- a/src/core/generateZodSchema.ts
+++ b/src/core/generateZodSchema.ts
@@ -256,6 +256,7 @@ function buildZodPrimitive({
         z,
         typeNode: f.createArrayTypeNode(typeNode.typeArguments[0]),
         isOptional,
+        isNullable,
         jsDocTags: {},
         sourceFile,
         dependencies,
@@ -270,6 +271,7 @@ function buildZodPrimitive({
         z,
         typeNode: typeNode.typeArguments[0],
         isOptional,
+        isNullable,
         jsDocTags,
         sourceFile,
         isPartial: true,
@@ -285,6 +287,7 @@ function buildZodPrimitive({
         z,
         typeNode: typeNode.typeArguments[0],
         isOptional,
+        isNullable,
         jsDocTags,
         sourceFile,
         isRequired: true,
@@ -300,6 +303,7 @@ function buildZodPrimitive({
         z,
         typeNode: typeNode.typeArguments[0],
         isOptional,
+        isNullable,
         jsDocTags,
         sourceFile,
         dependencies,


Test patch:
diff --git a/src/core/generateZodSchema.test.ts b/src/core/generateZodSchema.test.ts
index c476bff..bb9943b 100644
--- a/src/core/generateZodSchema.test.ts
+++ b/src/core/generateZodSchema.test.ts
@@ -831,6 +831,56 @@ describe("generateZodSchema", () => {
     `);
   });
 
+  it("should deal with array of null or null", () => {
+    const source = `export type Example = {
+        field?: Array<string | null> | null
+    }`;
+
+    expect(generate(source)).toMatchInlineSnapshot(`
+      "export const exampleSchema = z.object({
+          field: z.array(z.string().nullable()).optional().nullable()
+      });"
+    `);
+  });
+
+  it("should deal with partial or null", () => {
+    const source = `export type Example = {
+        field: Partial<{foo: string}> | null
+    }`;
+
+    expect(generate(source)).toMatchInlineSnapshot(`
+      "export const exampleSchema = z.object({
+          field: z.object({
+              foo: z.string()
+          }).nullable().partial()
+      });"
+    `);
+  });
+
+  it("should deal with ReadonlyArray or null", () => {
+    const source = `export type Example = {
+        field: ReadonlyArray<"foo" | "bar"> | null
+    }`;
+
+    expect(generate(source)).toMatchInlineSnapshot(`
+      "export const exampleSchema = z.object({
+          field: z.array(z.union([z.literal(\\"foo\\"), z.literal(\\"bar\\")])).nullable()
+      });"
+    `);
+  });
+
+  it("should deal with Record or null", () => {
+    const source = `export type Example = {
+        field: Record<string, string> | null
+    }`;
+
+    expect(generate(source)).toMatchInlineSnapshot(`
+      "export const exampleSchema = z.object({
+          field: z.record(z.string()).nullable()
+      });"
+    `);
+  });
+
   it("should allow nullable on union properties", () => {
     const source = `export interface A {
       a: number | string | null;
Repository: zh-lx/pinyin-pro
Pull request #253 (2024-06-14 07:19:18)

fix: 修复 .d.ts 文件中 alias 报错问题
fix: 修复 .d.ts 文件中 alias 报错问题


Patch:
diff --git a/lib/core/custom/index.ts b/lib/core/custom/index.ts
index 5ae09dd..5245e6b 100644
--- a/lib/core/custom/index.ts
+++ b/lib/core/custom/index.ts
@@ -1,6 +1,7 @@
 import { acTree } from '@/common/segmentit';
 import { Probability, Priority } from '@/common/constant';
-import { FastDictFactory, splitString, stringLength } from '@/common/utils';
+import { splitString, stringLength } from '@/common/utils';
+import { FastDictFactory } from '../../common/utils';
 import DICT1 from '@/data/dict1';
 let customDict: { [key: string]: string } = {};
 const customMultipleDict = new FastDictFactory();
diff --git a/lib/data/dict1.ts b/lib/data/dict1.ts
index 3529d3b..61bcedc 100644
--- a/lib/data/dict1.ts
+++ b/lib/data/dict1.ts
@@ -1,4 +1,4 @@
-import { FastDictFactory } from "@/common/utils";
+import { FastDictFactory } from "../common/utils";
 
 const map: { [key: string]: string[] } = {
   'bǎng páng pāng': ['膀'],
diff --git a/types/core/custom/index.d.ts b/types/core/custom/index.d.ts
index 5b526c1..e76751e 100644
--- a/types/core/custom/index.d.ts
+++ b/types/core/custom/index.d.ts
@@ -1,4 +1,4 @@
-import { FastDictFactory } from '@/common/utils';
+import { FastDictFactory } from '../../common/utils';
 type CustomHandleType = 'add' | 'replace';
 type CustomDictType = 'pinyin' | 'multiple' | 'polyphonic';
 interface CustomPinyinOptions {
diff --git a/types/data/dict1.d.ts b/types/data/dict1.d.ts
index 1859041..3cbca9d 100644
--- a/types/data/dict1.d.ts
+++ b/types/data/dict1.d.ts
@@ -1,3 +1,3 @@
-import { FastDictFactory } from "@/common/utils";
+import { FastDictFactory } from "../common/utils";
 declare const DICT1: FastDictFactory;
 export default DICT1;


Test patch:
diff --git a/test/type.test.js b/test/type.test.js
new file mode 100644
index 0000000..a5b2e8f
--- /dev/null
+++ b/test/type.test.js
@@ -0,0 +1,36 @@
+import { expect, describe, it } from "vitest";
+import path from 'path';
+import fs from 'fs';
+
+describe("types", () => {
+  it("[types]no alias", () => {
+    const typesDir = path.join(__dirname, '../types');
+    let hasAlias = false;
+
+    function checkFilesRecursively(dir) {
+      const files = fs.readdirSync(dir);
+    
+      files.forEach((file) => {
+        const filePath = path.join(dir, file);
+        const stats = fs.statSync(filePath);
+    
+        if (stats.isDirectory()) {
+          // 如果是文件夹，递归检查
+          checkFilesRecursively(filePath);
+        } else if (stats.isFile()) {
+          // 如果是文件，检查内容是否包含 '@/'
+          const data = fs.readFileSync(filePath, 'utf8');
+          if (data.includes('@/')) {
+            console.error('There are alias in .d.ts: ' + filePath);
+            hasAlias = true;
+          }
+        }
+      });
+    }
+    
+    // 开始检查
+    checkFilesRecursively(typesDir);
+
+    expect(hasAlias).to.be.equal(false);
+  });
+});
Repository: zh-lx/pinyin-pro
Pull request #268 (2024-07-31 11:42:33)

fix: 修复 segment api 文字最后的标点符号丢失问题
fix: 修复 segment api 文字最后的标点符号丢失问题


Patch:
diff --git a/lib/core/segment/middlewares.ts b/lib/core/segment/middlewares.ts
index acf3246..3fbc7be 100644
--- a/lib/core/segment/middlewares.ts
+++ b/lib/core/segment/middlewares.ts
@@ -75,6 +75,20 @@ export function middlewareSegment(list: SingleWordResult[], matches: MatchPatter
     }
   }
 
+  while (i < list.length) {
+    const item = list[i];
+    segments.push({
+      segment: [
+        {
+          origin: item.origin,
+          result: item.result,
+        }
+      ],
+      isZh: false,
+    });
+    i++;
+  }
+
   return segments;
 }
 


Test patch:
diff --git a/test/segment.test.js b/test/segment.test.js
index db1f137..cd4e1be 100644
--- a/test/segment.test.js
+++ b/test/segment.test.js
@@ -365,4 +365,18 @@ describe("segment separator", () => {
         "xiǎo/míng/shuòshì/bìyè/yú/zhōngguókēxuéyuàn/jìsuànsuǒ/，/hòu/zài/rìběnjīngdūdàxué/shēnzào",
     });
   });
+});
+
+describe("segment final nonZh", () => {
+  it("[separator]final nonZh", () => {
+    const result = segment(
+      "小明硕士毕业于中国科学院计算所，后在日本京都大学深造。",
+      {
+        format: OutputFormat.PinyinString,
+      }
+    );
+    expect(result).to.deep.equal(
+      "xiǎo míng shuòshì bìyè yú zhōngguókēxuéyuàn jìsuànsuǒ ， hòu zài rìběnjīngdūdàxué shēnzào 。"
+    );
+  });
 });
\ No newline at end of file
Repository: zh-lx/pinyin-pro
Pull request #271 (2024-08-03 09:53:34)

feat: 优化 html 自定义类名显示
## PR 的功能

feat: 优化 html 自定义类名显示



Patch:
diff --git a/lib/core/html/index.ts b/lib/core/html/index.ts
index 3745d7c..0a4d22e 100644
--- a/lib/core/html/index.ts
+++ b/lib/core/html/index.ts
@@ -76,14 +76,14 @@ export const html = (text: string, options?: HtmlOptions) => {
     }
     if (item.isZh) {
       // 汉字字符处理
-      const resultClass = completeOptions.resultClass;
-      const chineseClass = completeOptions.chineseClass;
-      const pinyinClass = completeOptions.pinyinClass;
+      const resultClass = completeOptions.resultClass || DefaultHtmlOptions.resultClass;
+      const chineseClass = completeOptions.chineseClass || DefaultHtmlOptions.chineseClass;
+      const pinyinClass = completeOptions.pinyinClass || DefaultHtmlOptions.pinyinClass;
       return `<span class="${resultClass}${additionalClass}"><ruby><span class="${chineseClass}">${item.origin}</span><rp>(</rp><rt class="${pinyinClass}">${item.pinyin}</rt><rp>)</rp></ruby></span>`;
     } else {
       // 非汉字字符处理
       if (completeOptions.wrapNonChinese) {
-        const nonChineseClass = completeOptions.nonChineseClass;
+        const nonChineseClass = completeOptions.nonChineseClass || DefaultHtmlOptions.nonChineseClass;
         return `<span class="${nonChineseClass}${additionalClass}">${item.origin}</span>`;
       } else {
         return item.origin;


Test patch:
diff --git a/test/html.test.js b/test/html.test.js
index 57e66d9..3aef583 100644
--- a/test/html.test.js
+++ b/test/html.test.js
@@ -87,4 +87,20 @@ describe('html', () => {
     expect(result).to.be.equal('<span class="py-result-item"><ruby><span class="py-chinese-item">汉</span><rp>(</rp><rt class="py-pinyin-item">hàn</rt><rp>)</rp></ruby></span><span class="py-result-item"><ruby><span class="py-chinese-item">字</span><rp>(</rp><rt class="py-pinyin-item">zì</rt><rp>)</rp></ruby></span>abc');
   });
 
+  it('[html-custom-class]自定义类名控制', () => {
+    const result = html('汉语，拼音', {
+      wrapNonChinese: true,
+      // @ts-ignore
+      resultClass: false,
+      // @ts-ignore
+      chineseClass: null,
+      // @ts-ignore
+      pinyinClass: false,
+      // @ts-ignore
+      nonChineseClass: null,
+    });
+    expect(result).to.be.equal(
+      `<span class="py-result-item"><ruby><span class="py-chinese-item">汉</span><rp>(</rp><rt class="py-pinyin-item">hàn</rt><rp>)</rp></ruby></span><span class="py-result-item"><ruby><span class="py-chinese-item">语</span><rp>(</rp><rt class="py-pinyin-item">yǔ</rt><rp>)</rp></ruby></span><span class="py-non-chinese-item">，</span><span class="py-result-item"><ruby><span class="py-chinese-item">拼</span><rp>(</rp><rt class="py-pinyin-item">pīn</rt><rp>)</rp></ruby></span><span class="py-result-item"><ruby><span class="py-chinese-item">音</span><rp>(</rp><rt class="py-pinyin-item">yīn</rt><rp>)</rp></ruby></span>`
+    );
+  });
 });