2020-10-17 23:53:33 +00:00
|
|
|
module.exports = {
|
2021-04-21 00:42:32 +00:00
|
|
|
'moduleNameMapper': {
|
|
|
|
'^js/(.*)': '<rootDir>/js/$1',
|
2021-05-25 19:08:10 +00:00
|
|
|
'^test/(.*)': '<rootDir>/test/$1',
|
2022-06-03 22:30:39 +00:00
|
|
|
'\\.css$': 'identity-obj-proxy',
|
2023-01-12 02:14:44 +00:00
|
|
|
'\\.scss$': 'identity-obj-proxy',
|
Fix issue #187 (and upgrade jest) (#188)
* Update jest to v29.5.0
This updates jest to the latest version (29.5.0) and fixes everything
that the upgrade breaks. One of the biggest differences is that the
mock types changed and I'm once again confused as to the "proper" way
to create mocks in jest. Whatever.
* Fix issue #187 were bank writing was not working correctly
Before, `mmu.ts` would deactivate writing to the language card if
`prewrite` was reset. However, it is totally possible to reset
`prewrite` and leave writing enabled, as shown my Sather in
_Understanding the Apple IIe_, table 5.5, p. 5-24. For example:
```assembly_x86
sta $c08a ; WRITE DISABLE; READ DISABLE
lda $c08b ; PRE-WRITE set
lda $c08b ; WRITE enabled
sta $c08a ; PRE-WRITE reset; WRITE still enabled!
lda $c08b ; PRE-WRITE set; WRITE still enabled!
```
would not work correctly because the last line would clear `_writebsr`
before setting `_prewrite`, which is incorrect.
Now, `_writebsr` is only set when `_prewrite` is set and thus only
cleared when `writeSwitch` is false. This matches Table 5.5.
* Fix pre-write for the language card
This is the same issue as the `MMU`, namely that `langcard.ts` would
deactivate writing to the language card if `prewrite` was reset.
However, it is totally possible to reset `prewrite` and leave writing
enabled, as shown my Sather in _Understanding the Apple II_, table
5.4, p. 5-30. See the previous commit for an example.
This change also adds a test for the `LanguageCard` class.
2023-07-08 18:18:38 +00:00
|
|
|
// For some reason the preact modules are not where they are
|
|
|
|
// expected. This seems to have something to do with jest > v27.
|
|
|
|
// https://github.com/preactjs/enzyme-adapter-preact-pure/issues/179#issuecomment-1201096897
|
|
|
|
'^preact(/(.*)|$)': 'preact$1',
|
2021-04-21 00:42:32 +00:00
|
|
|
},
|
2020-11-07 16:54:49 +00:00
|
|
|
'roots': [
|
|
|
|
'js/',
|
|
|
|
'test/',
|
|
|
|
],
|
|
|
|
'testMatch': [
|
2022-05-28 17:52:48 +00:00
|
|
|
'**/?(*.)+(spec|test).+(ts|js|tsx)'
|
2020-11-07 16:54:49 +00:00
|
|
|
],
|
|
|
|
'transform': {
|
|
|
|
'^.+\\.js$': 'babel-jest',
|
2022-05-28 17:52:48 +00:00
|
|
|
'^.+\\.ts$': 'ts-jest',
|
|
|
|
'^.*\\.tsx$': 'ts-jest',
|
2020-11-07 16:54:49 +00:00
|
|
|
},
|
Fix issue #187 (and upgrade jest) (#188)
* Update jest to v29.5.0
This updates jest to the latest version (29.5.0) and fixes everything
that the upgrade breaks. One of the biggest differences is that the
mock types changed and I'm once again confused as to the "proper" way
to create mocks in jest. Whatever.
* Fix issue #187 were bank writing was not working correctly
Before, `mmu.ts` would deactivate writing to the language card if
`prewrite` was reset. However, it is totally possible to reset
`prewrite` and leave writing enabled, as shown my Sather in
_Understanding the Apple IIe_, table 5.5, p. 5-24. For example:
```assembly_x86
sta $c08a ; WRITE DISABLE; READ DISABLE
lda $c08b ; PRE-WRITE set
lda $c08b ; WRITE enabled
sta $c08a ; PRE-WRITE reset; WRITE still enabled!
lda $c08b ; PRE-WRITE set; WRITE still enabled!
```
would not work correctly because the last line would clear `_writebsr`
before setting `_prewrite`, which is incorrect.
Now, `_writebsr` is only set when `_prewrite` is set and thus only
cleared when `writeSwitch` is false. This matches Table 5.5.
* Fix pre-write for the language card
This is the same issue as the `MMU`, namely that `langcard.ts` would
deactivate writing to the language card if `prewrite` was reset.
However, it is totally possible to reset `prewrite` and leave writing
enabled, as shown my Sather in _Understanding the Apple II_, table
5.4, p. 5-30. See the previous commit for an example.
This change also adds a test for the `LanguageCard` class.
2023-07-08 18:18:38 +00:00
|
|
|
'transformIgnorePatterns': [
|
|
|
|
'/node_modules/(?!(@testing-library/preact/dist/esm)/)',
|
|
|
|
],
|
2021-05-25 19:08:10 +00:00
|
|
|
'setupFilesAfterEnv': [
|
2022-06-01 00:41:24 +00:00
|
|
|
'<rootDir>/test/jest-setup.ts'
|
2021-05-25 19:08:10 +00:00
|
|
|
],
|
|
|
|
'coveragePathIgnorePatterns': [
|
|
|
|
'/node_modules/',
|
|
|
|
'/js/roms/',
|
|
|
|
'/test/',
|
Fix issue #187 (and upgrade jest) (#188)
* Update jest to v29.5.0
This updates jest to the latest version (29.5.0) and fixes everything
that the upgrade breaks. One of the biggest differences is that the
mock types changed and I'm once again confused as to the "proper" way
to create mocks in jest. Whatever.
* Fix issue #187 were bank writing was not working correctly
Before, `mmu.ts` would deactivate writing to the language card if
`prewrite` was reset. However, it is totally possible to reset
`prewrite` and leave writing enabled, as shown my Sather in
_Understanding the Apple IIe_, table 5.5, p. 5-24. For example:
```assembly_x86
sta $c08a ; WRITE DISABLE; READ DISABLE
lda $c08b ; PRE-WRITE set
lda $c08b ; WRITE enabled
sta $c08a ; PRE-WRITE reset; WRITE still enabled!
lda $c08b ; PRE-WRITE set; WRITE still enabled!
```
would not work correctly because the last line would clear `_writebsr`
before setting `_prewrite`, which is incorrect.
Now, `_writebsr` is only set when `_prewrite` is set and thus only
cleared when `writeSwitch` is false. This matches Table 5.5.
* Fix pre-write for the language card
This is the same issue as the `MMU`, namely that `langcard.ts` would
deactivate writing to the language card if `prewrite` was reset.
However, it is totally possible to reset `prewrite` and leave writing
enabled, as shown my Sather in _Understanding the Apple II_, table
5.4, p. 5-30. See the previous commit for an example.
This change also adds a test for the `LanguageCard` class.
2023-07-08 18:18:38 +00:00
|
|
|
],
|
|
|
|
'preset': 'ts-jest',
|
2021-04-21 00:42:32 +00:00
|
|
|
};
|