feat(pugongying): export xlsx via sheetjs
This commit is contained in:
@@ -192,14 +192,12 @@ test("createExportController previews and exports creator data", async () => {
|
||||
);
|
||||
|
||||
const exported = controller.exportSheet(["id", "name", "metrics.fans"]);
|
||||
assert.equal(exported.filename, "xhs-bloggers-20260312-160910.xls");
|
||||
assert.equal(exported.filename, "xhs-bloggers-20260312-160910.xlsx");
|
||||
assert.equal(exported.rows.length, 2);
|
||||
assert.deepEqual(exported.headers, ["ID", "达人昵称", "粉丝数"]);
|
||||
assert.match(exported.content, /<\?mso-application progid="Excel\.Sheet"\?>/);
|
||||
assert.match(exported.content, /<Worksheet ss:Name="达人数据">/);
|
||||
assert.match(exported.content, /达人昵称/);
|
||||
assert.match(exported.content, /达人-08d5/);
|
||||
assert.match(exported.content, /达人-3456/);
|
||||
assert.ok(Buffer.isBuffer(exported.content));
|
||||
assert.equal(exported.content[0], 0x50); // P
|
||||
assert.equal(exported.content[1], 0x4b); // K
|
||||
});
|
||||
|
||||
test("createExportController merges supplemental endpoint payloads into namespaced fields", async () => {
|
||||
|
||||
Reference in New Issue
Block a user