forked from remix-run/history
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
195 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
{ | ||
"esm/history.js": { | ||
"bundled": 28234, | ||
"minified": 12465, | ||
"gzipped": 3635, | ||
"bundled": 28364, | ||
"minified": 12515, | ||
"gzipped": 3683, | ||
"treeshaked": { | ||
"rollup": { | ||
"code": 226, | ||
"import_statements": 150 | ||
"code": 208, | ||
"import_statements": 132 | ||
}, | ||
"webpack": { | ||
"code": 1375 | ||
"code": 1324 | ||
} | ||
} | ||
}, | ||
"umd/history.js": { | ||
"bundled": 34665, | ||
"minified": 12190, | ||
"gzipped": 4109 | ||
"bundled": 33174, | ||
"minified": 12021, | ||
"gzipped": 3992 | ||
}, | ||
"umd/history.min.js": { | ||
"bundled": 32227, | ||
"minified": 10251, | ||
"gzipped": 3675 | ||
"bundled": 30690, | ||
"minified": 10155, | ||
"gzipped": 3616 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
modules/__tests__/TestSequences/LocationPathnameAlwaysSame.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import expect from 'expect'; | ||
|
||
import execSteps from './execSteps'; | ||
|
||
export default function(history, done) { | ||
const steps = [ | ||
() => { | ||
// encoded string | ||
const pathname = '/%E6%AD%B4%E5%8F%B2'; | ||
history.replace(pathname); | ||
}, | ||
location => { | ||
expect(location).toMatchObject({ | ||
pathname: '/%E6%AD%B4%E5%8F%B2' | ||
}); | ||
|
||
// encoded object | ||
const pathname = '/%E6%AD%B4%E5%8F%B2'; | ||
history.replace({ pathname }); | ||
}, | ||
location => { | ||
expect(location).toMatchObject({ | ||
pathname: '/%E6%AD%B4%E5%8F%B2' | ||
}); | ||
// unencoded string | ||
const pathname = '/歴史'; | ||
history.replace(pathname); | ||
}, | ||
location => { | ||
expect(location).toMatchObject({ | ||
pathname: '/歴史' | ||
}); | ||
// unencoded object | ||
const pathname = '/歴史'; | ||
history.replace({ pathname }); | ||
}, | ||
location => { | ||
expect(location).toMatchObject({ | ||
pathname: '/歴史' | ||
}); | ||
} | ||
]; | ||
|
||
execSteps(steps, history, done); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import expect from 'expect'; | ||
|
||
import execSteps from './execSteps'; | ||
|
||
export default function(history, done) { | ||
const steps = [ | ||
location => { | ||
expect(location).toMatchObject({ | ||
pathname: '/' | ||
}); | ||
|
||
const pathname = '/歴史'; | ||
const search = '?キー=値'; | ||
const hash = '#ハッシュ'; | ||
history.push(pathname + search + hash); | ||
}, | ||
(location, action) => { | ||
expect(action).toBe('PUSH'); | ||
expect(location).toMatchObject({ | ||
pathname: '/歴史', | ||
search: '?キー=値', | ||
hash: '#ハッシュ' | ||
}); | ||
} | ||
]; | ||
|
||
execSteps(steps, history, done); | ||
} |
34 changes: 0 additions & 34 deletions
34
modules/__tests__/TestSequences/WarnsForNonencodedPathname.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.