We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da4cfb0 commit c37b3ddCopy full SHA for c37b3dd
4 files changed
tests/main.test.ts
@@ -90,6 +90,8 @@ describe('#run', () => {
90
path.join(this.githubWorkspace, 'testdata', 'test2.txt'),
91
path.join(this.githubWorkspace, 'testdata', 'test1.txt'),
92
path.join(this.githubWorkspace, 'testdata', 'test.json'),
93
+ path.join(this.githubWorkspace, 'testdata', 'test.js'),
94
+ path.join(this.githubWorkspace, 'testdata', 'test.css'),
95
path.join(this.githubWorkspace, 'testdata', 'nested1', 'test1.txt'),
96
path.join(this.githubWorkspace, 'testdata', 'nested1', 'nested2', 'test3.txt'),
97
]);
@@ -131,6 +133,8 @@ describe('#run', () => {
131
133
path.join(this.githubWorkspace, 'testdata', '🚀'),
132
134
path.join(this.githubWorkspace, 'testdata', 'testfile'),
135
136
137
138
139
140
// Check arguments
tests/testdata/test.css
@@ -0,0 +1,3 @@
1
+body {
2
+ display: none;
3
+}
tests/testdata/test.js
+(() => {
+ alert('hi');
+})();
tests/upload.int.test.ts
@@ -146,6 +146,31 @@ describe('integration', () => {
146
expect(list).to.eql(['test1.txt']);
147
});
148
149
+ it('uploads files with the correct mime type', async function () {
150
+ const client = new Client({ projectID: projectID });
151
+ await client.upload({
152
+ root: './tests/testdata',
153
+ files: ['test.css', 'test.js', 'test.json', 'test1.txt'],
154
+ destination: this.testBucket,
155
+ });
156
+
157
+ const list = await getFilesInBucket(this.storage, this.testBucket);
158
+ const names = list.map((file) => file.name);
159
+ expect(names).to.eql(['test.css', 'test.js', 'test.json', 'test1.txt']);
160
161
+ const css = list[0];
162
+ expect(css?.metadata.contentType).to.eql('text/css');
163
164
+ const js = list[1];
165
+ expect(js?.metadata.contentType).to.eql('application/javascript');
166
167
+ const json = list[2];
168
+ expect(json?.metadata.contentType).to.eql('application/json');
169
170
+ const txt = list[3];
171
+ expect(txt?.metadata.contentType).to.eql('text/plain');
172
173
174
it('uploads a single file with prefix', async function () {
175
const client = new Client({ projectID: projectID });
176
await client.upload({
0 commit comments