Lines Matching refs:file
11 const rewrite = (file, url) => { argument
14 linkRewrite()(tree, file);
19 const file = makeFile('index.mdx'); constant
22 expect(rewrite(file, 'https://external.link')).toBe('https://external.link');
26 expect(rewrite(file, 'http://external.link?some=query')).toBe(
34 const file = makeFile('index.mdx'); constant
35 expect(rewrite(file, './#a-header')).toBe('/#a-header');
39 const file = makeFile('push-notifications/overview.mdx'); constant
40 expect(rewrite(file, './using-fcm.mdx#a-header')).toBe(
46 const file = makeFile('push-notifications/overview.mdx'); constant
47 expect(rewrite(file, '../index.mdx#a-header')).toBe('/#a-header');
52 const file = makeFile('index.mdx'); constant
55 expect(rewrite(file, 'guides')).toBe('/guides');
59 expect(rewrite(file, 'guides.mdx')).toBe('/guides/');
63 expect(rewrite(file, './guides.mdx')).toBe('/guides/');
67 expect(rewrite(file, './nested/reference.mdx')).toBe('/nested/reference/');
72 const file = makeFile('push-notifications/overview.mdx'); constant
75 expect(rewrite(file, 'using-fcm')).toBe('/push-notifications/using-fcm');
79 expect(rewrite(file, 'using-fcm.mdx')).toBe('/push-notifications/using-fcm/');
83 expect(rewrite(file, './using-fcm.mdx')).toBe('/push-notifications/using-fcm/');
87 expect(rewrite(file, '../guides.mdx')).toBe('/guides/');
91 expect(rewrite(file, './')).toBe('/push-notifications');
95 expect(rewrite(file, '../')).toBe('/');
99 expect(rewrite(file, '../index.mdx')).toBe('/');
104 const file = makeFile('versions/latest/sdk/app-auth.mdx'); constant
107 expect(rewrite(file, 'app-loading.mdx')).toBe('/versions/latest/sdk/app-loading/');
111 expect(rewrite(file, './app-loading.mdx')).toBe('/versions/latest/sdk/app-loading/');
115 expect(rewrite(file, '../config/app.mdx#android')).toBe('/versions/latest/config/app/#android');
119 expect(rewrite(file, '../../../debugging/runtime-issue.mdx')).toBe('/debugging/runtime-issue/');
124 const file = makeFile('debugging/runtime-issue.mdx'); constant
127 expect(rewrite(file, '#some-header')).toBe('/debugging/runtime-issue/#some-header');
131 expect(rewrite(file, './#some-header')).toBe('/debugging/runtime-issue/#some-header');