|
1 | | -import { describe, test, expect, beforeEach } from 'react-native-harness'; |
| 1 | +import { describe, test, expect } from 'react-native-harness'; |
2 | 2 | import { NativeFileSystem } from 'mendix-native'; |
3 | 3 |
|
4 | 4 | describe('NativeFileSystem', () => { |
5 | | - const testDir = 'harness-test-dir'; |
6 | 5 | const testFile = 'test-file.txt'; |
7 | | - const testFilePath = `${testDir}/${testFile}`; |
8 | | - |
9 | | - beforeEach(async () => { |
10 | | - // Clean up any existing test files/directories |
11 | | - try { |
12 | | - const exists = await NativeFileSystem.fileExists(testFilePath); |
13 | | - if (exists) { |
14 | | - await NativeFileSystem.remove(testFilePath); |
15 | | - } |
16 | | - } catch (error) { |
17 | | - // Ignore cleanup errors |
18 | | - } |
19 | | - }); |
20 | 6 |
|
21 | 7 | describe('Constants', () => { |
22 | 8 | test('should have DocumentDirectoryPath defined', () => { |
23 | 9 | const documentDirectory = NativeFileSystem.DocumentDirectoryPath; |
24 | 10 | const relativePath = |
25 | 11 | NativeFileSystem.relativeToDocumentsAbsolutePath(testFile); |
26 | | - expect(typeof NativeFileSystem.DocumentDirectoryPath).toBe('string'); |
27 | | - expect(NativeFileSystem.DocumentDirectoryPath.length).toBeGreaterThan(0); |
| 12 | + expect(typeof documentDirectory).toBe('string'); |
| 13 | + expect(documentDirectory.length).toBeGreaterThan(0); |
28 | 14 | expect(relativePath).toBe(`${documentDirectory}/${testFile}`); |
29 | | - }); |
30 | | - |
31 | | - test('should have SUPPORTS_DIRECTORY_MOVE as true', () => { |
32 | 15 | expect(NativeFileSystem.SUPPORTS_DIRECTORY_MOVE).toBe(true); |
33 | | - }); |
34 | | - |
35 | | - test('should have SUPPORTS_ENCRYPTION as true', () => { |
36 | 16 | expect(NativeFileSystem.SUPPORTS_ENCRYPTION).toBe(true); |
37 | 17 | }); |
38 | 18 | }); |
|
0 commit comments